-
Notifications
You must be signed in to change notification settings - Fork 94
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
scx_layered: Make layered idle CPU selection topology aware #683
Conversation
Make idle CPU selection topology aware. Signed-off-by: Daniel Hodges <[email protected]>
Signed-off-by: Daniel Hodges <[email protected]>
Signed-off-by: Daniel Hodges <[email protected]>
} | ||
bpf_cpumask_copy(pref_idle_cpumask, idle_cpumask); | ||
bpf_cpumask_and(pref_idle_cpumask, cache_cpumask, pref_idle_cpumask); | ||
bpf_cpumask_and(pref_idle_cpumask, layer_cpumask, pref_idle_cpumask); |
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.
This is likely okay for now but cpumasks can become rather big and these cpumask manipulations can become expensive. Down the line, it probably would make sense to maintain these masks persistently in each layer.
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.
That makes sense and then we'd only have to update the masks when the layers change size.
@@ -1030,7 +1076,7 @@ static bool keep_running(struct cpu_ctx *cctx, struct task_struct *p) | |||
|
|||
/* | |||
* If @p is in an open layer, keep running if there's any idle | |||
* CPU. If confined, keep running iff the layer has idle CPUs. | |||
* CPU. If confined, keep running if the layer has idle 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 think iff
is intentional, meaning if and only if
.
Fix comment to be more accurate. Signed-off-by: Daniel Hodges <[email protected]>
Make scx_layered idle CPU selection topology aware. It first tries to select an idle CPU from the local LLC before attempting to select an idle CPU from the local node.