Commit 2c14fa80 authored by Sebastian Andrzej Siewior's avatar Sebastian Andrzej Siewior
Browse files

sched: Make the idle timer expire always in hardirq context.

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 hardirq 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 hardirq context.


 ("sched/idle: Add support for tasks that inject idle")
Reported-by: default avatarThomas Gleixner <>
Signed-off-by: default avatarSebastian Andrzej Siewior <>
parent aed77e1b
......@@ -379,10 +379,10 @@ void play_idle_precise(u64 duration_ns, u64 latency_ns)
it.done = 0;
hrtimer_init_on_stack(&it.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
hrtimer_init_on_stack(&it.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_HARD);
it.timer.function = idle_inject_timer_fn;
hrtimer_start(&it.timer, ns_to_ktime(duration_ns),
while (!READ_ONCE(it.done))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment