scx_mitosis: adaptive stealing, orphan-DSQ drain, migration tracking#3572
Draft
tommy-u wants to merge 1 commit into
Draft
scx_mitosis: adaptive stealing, orphan-DSQ drain, migration tracking#3572tommy-u wants to merge 1 commit into
tommy-u wants to merge 1 commit into
Conversation
1) Adaptive stealing controller. Per-cell sibling-LLC queue-depth
threshold (per_cell_steal_min_queued[]) tuned by userspace from the
observed steal-success ratio. try_stealing_work picks the most
backed-up sibling LLC and only steals if its depth exceeds the
threshold, throttling cross-LLC churn under low pressure.
2) Drain for orphaned tasks. When apply_cell_config or a cgroup
change shrinks a cell out of an LLC, recalc_cell_llc_counts now
publishes the new per-LLC cpu_cnt and then iterates the stranded
(cell, LLC) DSQ, moving each task to a sibling LLC's DSQ that the
cell still owns CPUs in. Caller order is publish_prepared_cpumask
first, then recalc, so re-pickers triggered by the cpu_cnt==0 guard
see the new cell membership.
3) Migration source tracking. New last_cpu_source field on task_ctx
plus 2x3 cross-product counters (same|cross)x(select|enqueue|
dispatch). track_cpu_migration in mitosis_running attributes each
migration to whichever path placed the task. Stolen-task tagging
collapses into maybe_retag_stolen_task (LLC mismatch is the unique
steal signal at running time), removing the per-CPU stolen_dispatch
flag and its dispatch-to-running race window.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adaptive stealing controller. Per-cell sibling-LLC queue-depth
threshold (per_cell_steal_min_queued[]) tuned by userspace from the
observed steal-success ratio. try_stealing_work picks the most
backed-up sibling LLC and only steals if its depth exceeds the
threshold, throttling cross-LLC churn under low pressure.
Drain for orphaned tasks. When apply_cell_config or a cgroup
change shrinks a cell out of an LLC, recalc_cell_llc_counts now
publishes the new per-LLC cpu_cnt and then iterates the stranded
(cell, LLC) DSQ, moving each task to a sibling LLC's DSQ that the
cell still owns CPUs in. Caller order is publish_prepared_cpumask
first, then recalc, so re-pickers triggered by the cpu_cnt==0 guard
see the new cell membership.
Migration source tracking. New last_cpu_source field on task_ctx
plus 2x3 cross-product counters (same|cross)x(select|enqueue|
dispatch). track_cpu_migration in mitosis_running attributes each
migration to whichever path placed the task. Stolen-task tagging
collapses into maybe_retag_stolen_task (LLC mismatch is the unique
steal signal at running time), removing the per-CPU stolen_dispatch
flag and its dispatch-to-running race window.