sched/idle: Make the idle timer expire in hard interrupt context
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Mon, 6 Sep 2021 11:30:34 +0000 (13:30 +0200)
committerDom Cobley <popcornmix@gmail.com>
Thu, 14 Oct 2021 11:33:04 +0000 (12:33 +0100)
commitf595ad8c79c7ee3e1866bb6ef92b80ba61c47666
treee425040dcadf0c68173fbf3096665fb0f45212f7
parent8fa40ea367d6638e364dc12909607e969b44f76b
sched/idle: Make the idle timer expire in hard interrupt context

[ Upstream commit 9848417926353daa59d2b05eb26e185063dbac6e ]

The intel powerclamp driver will setup a per-CPU worker with RT
priority. The worker will then invoke play_idle() in which it remains in
the idle poll loop until it is stopped by the timer it started earlier.

That timer needs to expire in hard interrupt context on PREEMPT_RT.
Otherwise the timer will expire in ksoftirqd as a SOFT timer but that task
won't be scheduled on the CPU because its priority is lower than the
priority of the worker which is in the idle loop.

Always expire the idle timer in hard interrupt context.

Reported-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20210906113034.jgfxrjdvxnjqgtmc@linutronix.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
kernel/sched/idle.c