]> www.infradead.org Git - users/jedix/linux-maple.git/commit
sched, psi: Don't account irq time if sched_clock_irqtime is disabled
authorYafang Shao <laoar.shao@gmail.com>
Fri, 3 Jan 2025 02:24:08 +0000 (10:24 +0800)
committerPeter Zijlstra <peterz@infradead.org>
Mon, 13 Jan 2025 13:10:26 +0000 (14:10 +0100)
commita6fd16148fdd7e9da143037106956a3447c247a8
treee2e8d1f87bba29d38768ddd64ef1e21bb7d8d386
parent763a744e24a8cfbcc13f699dcdae13a627b8588e
sched, psi: Don't account irq time if sched_clock_irqtime is disabled

sched_clock_irqtime may be disabled due to the clock source. When disabled,
irq_time_read() won't change over time, so there is nothing to account. We
can save iterating the whole hierarchy on every tick and context switch.

Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Michal Koutný <mkoutny@suse.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Link: https://lore.kernel.org/r/20250103022409.2544-4-laoar.shao@gmail.com
kernel/sched/psi.c