Re: [PATCH] sched/fair: Avoid false sharing in nohz struct
From: Shubhang Kaushik Prasanna Kumar
Date: Thu Dec 18 2025 - 20:38:06 EST
Hi Wangyang Guo,
While the intuition behind isolating the `nr_cpus` counter seems correct, could you please justify the added padding ? As this is a high contention path in the scheduler, we shouldn't be inflating global structures with padding on logic alone. I’d like to see some benchmarking such as `perf c2c` results from a multi-core system proving the `false sharing` scenario as a measurable bottleneck.
I am also concerned about the internal layout. By sandwiching the timer fields between two `__cacheline_aligned` boundaries, we might just be shifting the contention rather than fixing it. See to it that fields like `next_balance` aren't being squeezed into a new conflict zone. Would like to review the benchmark data and the struct layout before we move forward.
Thanks,
Shubhang Kaushik