Commit 37bb6cb4097e29ffee970065b74499cbf10603a3
Committed by
Ingo Molnar
1 parent
d3d74453c3
Exists in
master
and in
39 other branches
hrtimer: unlock hrtimer_wakeup
hrtimer_wakeup creates a base->lock rq->lock lock dependancy. Avoid this by switching to HRTIMER_CB_IRQSAFE_NO_SOFTIRQ which doesn't hold base->lock. This fully untangles hrtimer locks from the scheduler locks, and allows hrtimer usage in the scheduler proper. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Showing 1 changed file with 3 additions and 1 deletions Side-by-side Diff
kernel/hrtimer.c
... | ... | @@ -1293,7 +1293,7 @@ |
1293 | 1293 | sl->timer.function = hrtimer_wakeup; |
1294 | 1294 | sl->task = task; |
1295 | 1295 | #ifdef CONFIG_HIGH_RES_TIMERS |
1296 | - sl->timer.cb_mode = HRTIMER_CB_IRQSAFE_NO_RESTART; | |
1296 | + sl->timer.cb_mode = HRTIMER_CB_IRQSAFE_NO_SOFTIRQ; | |
1297 | 1297 | #endif |
1298 | 1298 | } |
1299 | 1299 | |
... | ... | @@ -1304,6 +1304,8 @@ |
1304 | 1304 | do { |
1305 | 1305 | set_current_state(TASK_INTERRUPTIBLE); |
1306 | 1306 | hrtimer_start(&t->timer, t->timer.expires, mode); |
1307 | + if (!hrtimer_active(&t->timer)) | |
1308 | + t->task = NULL; | |
1307 | 1309 | |
1308 | 1310 | if (likely(t->task)) |
1309 | 1311 | schedule(); |