Skip to content
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: Fix idle core selection #696

Merged
merged 1 commit into from
Sep 26, 2024

Conversation

hodgesds
Copy link
Contributor

Fix idle core selection to correctly use pick_idle_cpu_from. Previously it was passing in the mask of the topology (LLC/node) rather than the idle mask of the topology. This will be refactored in the future when struct layer_cpumask_wrapper gets support for additional bpf_cpumasks for topologies.

Fix idle core selection to correctly use pick_idle_cpu_from.

Signed-off-by: Daniel Hodges <[email protected]>
@hodgesds
Copy link
Contributor Author

Tested with @JakeHillion with following config:

[{
  "name":"random",
  "comment":"random user",
  "matches":[
     [{"UIDEquals":1234}]
  ],
  "kind": {
    "Confined":{
      "nodes":[1],
      "util_range": [0.25, 0.7],
      "growth_algo": "Random",
      "llcs": [1, 0],
      "preempt": false,
      "slice_us": 500,
      "exclusive": false
     }
  }
},
{
  "name":"hodgesd",
  "comment":"hodgesd user",
  "matches":[
     [{"UIDEquals":224791}]
  ],
  "kind": {
    "Confined":{
      "slice_us": 800,
      "util_range": [0.25, 0.6],
      "growth_algo": "Topo",
      "nodes": [1, 0],
      "preempt": true,
      "preempt_first": true,
      "exclusive": true
     }
  }
},{
  "name":"stress-ng",
  "comment":"stress-ng slice",
  "matches":[
     [
	     {"CommPrefix":"stress-ng"}
     ],[
	     {"PcommPrefix":"stress-ng"}
     ]],
  "kind": {
    "Confined":{
      "util_range": [0.05, 0.80],
      "slice_us": 800,
      "preempt": false,
      "preempt_first": false,
      "growth_algo": "RoundRobin",
      "exclusive": true
     }
  }
},
{
  "name":"normal",
  "comment":"the rest",
  "matches":[[]],
  "kind":{
    "Confined": {
      "util_range": [0.25, 0.6],
      "preempt": true,
      "preempt_first": true,
      "slice_us": 800,
      "exclusive": true,
      "growth_algo": "Sticky"
    }
  }
}]

stress-ng gets spread across NUMA nodes properly:
image

Copy link
Contributor

@JakeHillion JakeHillion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on an 11 CCX machine with RoundRobin. Seems to work great with this change, thanks for the fix!

image

@hodgesds hodgesds merged commit 326ccb3 into sched-ext:main Sep 26, 2024
18 of 19 checks passed
@hodgesds hodgesds deleted the layered-growth-fixes branch September 26, 2024 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants