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 core selection #524

Merged
merged 1 commit into from
Aug 21, 2024

Conversation

hodgesds
Copy link
Contributor

Fix a bug introduced in #510 where it assumed core ids are incremental. This refactors the core ordering for layers to be far more simple and provide some space for layer core isolation in low utilization.

Tested by adding some logs on the core selection values:

$ sudo ./bin_local/bin/scx_layered --monitor 5 f:user.json -vvv 2>&1 | grep xxx
02:25:45 [TRACE] xxx layer random cores 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 
02:25:45 [TRACE] xxx layer hodgesd cores 36, 37, 38, 39, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 
02:25:45 [TRACE] xxx layer stress-ng cores 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 0, 1, 2, 3, 4, 5, 6, 7, 
02:25:45 [TRACE] xxx layer normal cores 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 

Using the following config:

[{
  "name":"random",
  "comment":"random user",
  "matches":[
     [{"UIDEquals":1234}]
  ],
  "kind": {
    "Confined":{
      "nodes":[1],
      "util_range": [0.05, 0.7],
      "preempt": false,
      "exclusive": true
     }
  }
},
{
  "name":"hodgesd",
  "comment":"hodgesd user",
  "matches":[
     [{"UIDEquals":224791}]
  ],
  "kind": {
    "Confined":{
      "nodes":[1],
      "util_range": [0.05, 0.3],
      "exclusive": false
     }
  }
},{
  "name":"stress-ng",
  "comment":"stress-ng slice",
  "matches":[
     [
             {"CommPrefix":"stress-ng"}
     ],[
             {"PcommPrefix":"stress-ng"}
     ]],
  "kind": {
    "Confined":{
      "util_range": [0.05, 0.70],
      "nodes":[1],
      "exclusive": false
     }
  }
},
{
  "name":"normal",
  "comment":"the rest",
  "matches":[[]],
  "kind":{
    "Grouped": {
      "util_range": [0.05, 0.7],
      "preempt": true,
      "exclusive": true,
      "nodes":[0]
    }
  }
}]

stress-ng run as user:
image
stress-ng run as root:
image

Fix a bug introduced in sched-ext#510 where it assumed core ids are incremental.
This refactors the core ordering for layers to be far more simple and
provide some space for layer core isolation in low utilization.

Signed-off-by: Daniel Hodges <[email protected]>
@hodgesds hodgesds requested a review from htejun August 21, 2024 02:36
@hodgesds hodgesds merged commit f2a6661 into sched-ext:main Aug 21, 2024
2 checks passed
@hodgesds hodgesds deleted the layered-core-fixes branch August 21, 2024 12:13
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