-
Notifications
You must be signed in to change notification settings - Fork 84
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: Add per layer weights #735
Conversation
if (disable_topology) { | ||
if (MEMBER_VPTR(layers, [layer_idx].preempt) && scx_bpf_consume(layer_idx)) |
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.
cc @samuelnair this is reverting back to the previous logic of disabled topology.
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.
Some comments, a few rust nits, but LGTM.
Add weights to layers and use the infeasible weights crate to properly apply weights during contention to prevent starvation. Signed-off-by: Daniel Hodges <[email protected]>
Add stats for infeasible weights adjusted layer stats. Signed-off-by: Daniel Hodges <[email protected]>
Add weights to userspace layer config. Signed-off-by: Daniel Hodges <[email protected]>
Signed-off-by: Daniel Hodges <[email protected]>
Signed-off-by: Daniel Hodges <[email protected]>
Add two new flags `layer_preempt_weight_disable` and `layer_growth_weight_disable` to disabled preemption and layer growth when weighted layer load exceeds the configured threshold. Signed-off-by: Daniel Hodges <[email protected]>
Add a flag to control DSQ iteration across layers by layer weight. This helps prevent starvation by iterating over layers with the lowest weight first. Signed-off-by: Daniel Hodges <[email protected]>
Signed-off-by: Daniel Hodges <[email protected]>
Signed-off-by: Daniel Hodges <[email protected]>
Fix a bug to use duty cycle for infeasible weights calculations. Signed-off-by: Daniel Hodges <[email protected]>
Signed-off-by: Daniel Hodges <[email protected]>
Add DSQ iteration algorithms. Signed-off-by: Daniel Hodges <[email protected]>
Signed-off-by: Daniel Hodges <[email protected]>
Cleanup from code review. Signed-off-by: Daniel Hodges <[email protected]>
047cd0a
to
0476a10
Compare
Cleanup the calculation of the infeasible weight to not use an unneccesary collect. Signed-off-by: Daniel Hodges <[email protected]>
Signed-off-by: Daniel Hodges <[email protected]>
Testing different iteration orders:
|
Signed-off-by: Daniel Hodges <[email protected]>
This partially implements #646 |
This is a rather large PR and I can break it into smaller chunks if needed. There are a few new features added:
layer dsq iteration algos: There's now an implementation that allows for different layer DSQ iteration algorithms. Currently, the algorithm is a round robin style iteration algorithm but it has caused some performance regressions as noted by @samuelnair. This should provide more configuration to the scheduler.
layer weights: The BPF side of layer weighting is not done and will be added in future PRs as this PR is already too large. The weights of a layer are used during layer growth in user-space side as well weighted utilization/load metrics via stats.
layer growth/preemption disabling based on load: These features are additional configuration that allow to disable preemption/layer growth on layers that are utilizing beyond the configured threshold.
stats output: