sched: Annotate sched_clock_irqtime with __read_mostly
PATCH 1/1 sched: Annotate sched_clock_irqtime with __read_mostly
Eric reported an issue [0] as follows,
: rebalance_domains() can attempt to change sched_balance_running : more than 350,000 times per second on our servers.
: If sched_clock_irqtime and sched_balance_running share the : same cache line, we see a very high cost on hosts with 480 threads : dealing with many interrupts.
While the rebalance_domains() issue has been resolved [1], we should proactively annotate sched_clock_irqtime with __read_mostly to prevent potential cacheline false sharing. This optimization is particularly justified since sched_clock_irqtime is only modified during TSC instability events.
Reported-by Eric Dumazet <[email protected]>
Debugged-by Eric Dumazet <[email protected]>
Signed-off-by Yafang Shao <[email protected]>
Reviewed-by Michal Koutný <[email protected]>
Cc Eric Dumazet <[email protected]>
--- kernel/sched/cputime.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/sched/cputime.c +1 -1
@@ -22,7 +22,7 @@*/ DEFINE_PER_CPU(struct irqtime, cpu_irqtime); -int sched_clock_irqtime; +int __read_mostly sched_clock_irqtime;void enable_sched_clock_irqtime (void ) {
Signature · 1 line
2.43.5