Commit 67b95fd
committed
scx_p2dq: Add L2 cluster-aware CPU selection
Add L2 cluster awareness to improve cache locality by preferring CPUs
within the same cluster before searching the wider LLC domain.
Infrastructure:
- Add cluster_id to cpu_ctx for per-CPU cluster tracking
- Add has_clusters flag to topo_config
- Initialize cluster_id for each CPU during BPF setup
- Populate cluster IDs from topology in userspace
Implementation:
- Add pick_idle_cpu_in_cluster() helper to search cluster cpumask
- Enhance pick_idle_cpu() to try cluster-level before LLC-level
- Update wakeup paths for interactive tasks to prefer cluster
- Check same-cluster waker/wakee before wider search
This improves cache locality by keeping related tasks on CPUs sharing
L2 cache, reducing cache misses and improving performance.
Signed-off-by: Daniel Hodges <[email protected]>1 parent d86cd11 commit 67b95fd
File tree
4 files changed
+1074
-714
lines changed- scheds/rust/scx_p2dq/src
- bpf
4 files changed
+1074
-714
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
| 17 | + | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | 22 | | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
36 | 36 | | |
37 | | - | |
38 | | - | |
| 37 | + | |
| 38 | + | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | | - | |
43 | | - | |
| 42 | + | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | | - | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| |||
0 commit comments