aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/hrtimer.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/hrtimer.c')
-rw-r--r--kernel/hrtimer.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index 635739d219da..ffca825d24bc 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -1000,10 +1000,18 @@ hrtimer_start(struct hrtimer *timer, ktime_t tim, const enum hrtimer_mode mode)
1000 */ 1000 */
1001 raise = timer->state == HRTIMER_STATE_PENDING; 1001 raise = timer->state == HRTIMER_STATE_PENDING;
1002 1002
1003 /*
1004 * We use preempt_disable to prevent this task from migrating after
1005 * setting up the softirq and raising it. Otherwise, if me migrate
1006 * we will raise the softirq on the wrong CPU.
1007 */
1008 preempt_disable();
1009
1003 unlock_hrtimer_base(timer, &flags); 1010 unlock_hrtimer_base(timer, &flags);
1004 1011
1005 if (raise) 1012 if (raise)
1006 hrtimer_raise_softirq(); 1013 hrtimer_raise_softirq();
1014 preempt_enable();
1007 1015
1008 return ret; 1016 return ret;
1009} 1017}