diff options
| author | Usama Arif <usama.arif@linux.dev> | 2026-09-24 09:14:46 -0700 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2026-09-24 06:47:13 -1000 |
| commit | a87743bd9e9bef4b69d6fcce992cdaaa8edb78e3 (patch) | |
| tree | 6c95a6980dd3b2920bb8f5cbd0a7198b76ed37d2 /tools/perf/python | |
| parent | e9b9ad3c138020dffcaddede86d91c984682806b (diff) | |
| download | linux-next-a87743bd9e9bef4b69d6fcce992cdaaa8edb78e3.tar.gz linux-next-a87743bd9e9bef4b69d6fcce992cdaaa8edb78e3.zip | |
sched_ext: Place dsq_vtime next to dsq_priq
scx_dispatch_enqueue() calls rb_add() for a vtime-ordered DSQ while
holding dsq->lock. At each level of the descent, scx_dsq_priq_less()
loads the visited task's dsq_vtime, and that comparison selects rb_left
or rb_right from the same task's dsq_priq. In the x86-64 benchmark
configuration, these accesses fell on different 64-byte cache lines
before this change, so a cold visited task could require a second cache
line fill on the dependent descent path.
Move dsq_vtime immediately before dsq_priq, keeping dsq_seq and
dsq_flags next to dsq_list. In the two x86-64 layouts inspected, where
scx starts at offsets 776 and 840 in task_struct, the fields from
dsq_list through dsq_priq occupy one cache line. The exact cache line
placement depends on the containing task_struct layout and is not
guaranteed for every configuration or architecture. Where they share a
line, avoiding the dependent cache line fill helps reduce dsq->lock hold
time during vtime insertion and therefore contention on the lock.
In a 16-vCPU KVM guest, the instrumented enqueue interval was 4-6%
shorter with scx_lavd and scx_layered. scx_mitosis and end-to-end
workload time showed no consistent change.
This only reorders fields; no scheduling behavior change is intended.
Signed-off-by: Usama Arif <usama.arif@linux.dev>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'tools/perf/python')
0 files changed, 0 insertions, 0 deletions
