Commit ee3ece83 authored by Steven Rostedt's avatar Steven Rostedt Committed by Linus Torvalds

hrtimer: prevent migration for raising softirq

Due to a possible deadlock, the waking of the softirq was pushed outside
of the hrtimer base locks. See commit 0c96c597

Unfortunately this allows the task to migrate after setting up the softirq
and raising it. Since softirqs run a queue that is per-cpu we may raise the
softirq on the wrong CPU and this will keep the queued softirq task from

To solve this issue, this patch disables preemption around the releasing
of the hrtimer lock and raising of the softirq.
Signed-off-by: default avatarSteven Rostedt <>
Signed-off-by: default avatarLinus Torvalds <>
parent 6beef7eb
......@@ -1003,10 +1003,18 @@ hrtimer_start(struct hrtimer *timer, ktime_t tim, const enum hrtimer_mode mode)
raise = timer->state == HRTIMER_STATE_PENDING;
* We use preempt_disable to prevent this task from migrating after
* setting up the softirq and raising it. Otherwise, if me migrate
* we will raise the softirq on the wrong CPU.
unlock_hrtimer_base(timer, &flags);
if (raise)
return ret;
Markdown is supported
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