-
Notifications
You must be signed in to change notification settings - Fork 201
scx_p2dq: Add L2 cluster-aware CPU selection #3114
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
base: main
Are you sure you want to change the base?
Conversation
39a308e to
8277399
Compare
|
Comparison: Optimized Cluster-Aware vs Baseline schbench Latency Test (2 threads × 16 messages, 30s) - 5 Run Average
Result: Near-identical performance with baseline in low-contention scenarios. stress-ng Cache Benchmark (60s, 316 workers)
Result: Significant cache performance improvement from L2 locality. stress-ng CPU Benchmark (60s, 316 workers)
Result: No CPU throughput regression. schbench High Load Test (8 threads × 32 messages, 30s)
Result: Improved performance under high contention. Key Findings ✅ Wins
|
|
clangd-format messed up some of the bpf code, will push a fix. |
67b95fd to
c824611
Compare
Detect L2 cache domains within LLCs by reading CPU cache topology from sysfs. This enables schedulers to make cache-aware placement decisions at a finer granularity than LLC. Signed-off-by: Daniel Hodges <[email protected]>
Drop topo.all_clusters before iterating topo.all_cores to release Arc references. Clusters hold Arc references to cores, preventing Arc::into_inner() from succeeding during topology setup. Signed-off-by: Daniel Hodges <[email protected]>
c824611 to
b14b678
Compare
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]>
b14b678 to
5f7f1db
Compare
Add L2 cluster awareness to improve cache locality by preferring CPUs
within the same cluster before searching the wider LLC domain.
Infrastructure:
Implementation:
This improves cache locality by keeping related tasks on CPUs sharing
L2 cache, reducing cache misses and improving performance.