diff options
Diffstat (limited to 'kernel/hrtimer.c')
-rw-r--r-- | kernel/hrtimer.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index 421be5fe5cc7..ffca825d24bc 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c | |||
@@ -300,11 +300,10 @@ EXPORT_SYMBOL_GPL(ktime_sub_ns); | |||
300 | */ | 300 | */ |
301 | u64 ktime_divns(const ktime_t kt, s64 div) | 301 | u64 ktime_divns(const ktime_t kt, s64 div) |
302 | { | 302 | { |
303 | u64 dclc, inc, dns; | 303 | u64 dclc; |
304 | int sft = 0; | 304 | int sft = 0; |
305 | 305 | ||
306 | dclc = dns = ktime_to_ns(kt); | 306 | dclc = ktime_to_ns(kt); |
307 | inc = div; | ||
308 | /* Make sure the divisor is less than 2^32: */ | 307 | /* Make sure the divisor is less than 2^32: */ |
309 | while (div >> 32) { | 308 | while (div >> 32) { |
310 | sft++; | 309 | sft++; |
@@ -632,8 +631,6 @@ void clock_was_set(void) | |||
632 | */ | 631 | */ |
633 | void hres_timers_resume(void) | 632 | void hres_timers_resume(void) |
634 | { | 633 | { |
635 | WARN_ON_ONCE(num_online_cpus() > 1); | ||
636 | |||
637 | /* Retrigger the CPU local events: */ | 634 | /* Retrigger the CPU local events: */ |
638 | retrigger_next_event(NULL); | 635 | retrigger_next_event(NULL); |
639 | } | 636 | } |
@@ -1003,10 +1000,18 @@ hrtimer_start(struct hrtimer *timer, ktime_t tim, const enum hrtimer_mode mode) | |||
1003 | */ | 1000 | */ |
1004 | raise = timer->state == HRTIMER_STATE_PENDING; | 1001 | raise = timer->state == HRTIMER_STATE_PENDING; |
1005 | 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 | |||
1006 | unlock_hrtimer_base(timer, &flags); | 1010 | unlock_hrtimer_base(timer, &flags); |
1007 | 1011 | ||
1008 | if (raise) | 1012 | if (raise) |
1009 | hrtimer_raise_softirq(); | 1013 | hrtimer_raise_softirq(); |
1014 | preempt_enable(); | ||
1010 | 1015 | ||
1011 | return ret; | 1016 | return ret; |
1012 | } | 1017 | } |