-
Notifications
You must be signed in to change notification settings - Fork 187
scx_p2dq: Add backwards sticky scheduling #2085
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
IIUC this tracks where the task has been and tries to reuse the same CPUs? Not very clear on the & operations in the code bc it looks like ->bs is a mask and nr_cpus/cpu is a number, but I might be missing sth |
7c4b055 to
08dbe60
Compare
Whoops, looks like I accidently added some BS... should be good now! |
08dbe60 to
8c6a1f3
Compare
| bpf_for(i, 0, nr_cpus) | ||
| if (taskc->bs_mask == 0 || (taskc->bs_mask & i) != i) { | ||
| if (i == nr_cpus - 1) | ||
| taskc->bs_mask &= nr_cpus; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a bit confused about the idea of bs_mask. Is it safe/correct to bitwise operation between bitmask (bs_mask) and just integer numbers (nr_cpus and task_cpu)? It would a good idea to add some comments about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably not super safe and I think the &= should be an |=. After thinking about this more though it probably belongs in scx_chaos. The right way to do this in p2dq would be to put this into a scx_bitmap_t since the task_ctx in p2dq is arena allocated.
8c6a1f3 to
a165d1f
Compare
Backwards sticky scheduling ensures the task thrashes all CPUs like a bull in a china shop before it matures and settles down to realize it's true potential by staying sticky to it's roots. Or some BS like that... Signed-off-by: Daniel Hodges <[email protected]>
a165d1f to
96e11ae
Compare
Signed-off-by: Daniel Hodges <[email protected]>
96e11ae to
1f0bd16
Compare

Backwards sticky scheduling ensures the task thrashes all CPUs like a bull in a china shop before it matures and settles down to realize it's true potential by staying sticky to it's roots. Or some BS like that...
Perfomance tests:
Full o' BS (with the
--bsflag):No BS:
Doesn't seem to add much BS, should be safe to run in production!