diff options
Diffstat (limited to 'kernel/time/tick-sched.c')
-rw-r--r-- | kernel/time/tick-sched.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index a87b0468568b..b33be61c0f6b 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c | |||
@@ -288,7 +288,7 @@ void tick_nohz_stop_sched_tick(int inidle) | |||
288 | goto out; | 288 | goto out; |
289 | } | 289 | } |
290 | 290 | ||
291 | ts->idle_tick = ts->sched_timer.expires; | 291 | ts->idle_tick = hrtimer_get_expires(&ts->sched_timer); |
292 | ts->tick_stopped = 1; | 292 | ts->tick_stopped = 1; |
293 | ts->idle_jiffies = last_jiffies; | 293 | ts->idle_jiffies = last_jiffies; |
294 | rcu_enter_nohz(); | 294 | rcu_enter_nohz(); |
@@ -419,21 +419,21 @@ void tick_nohz_restart_sched_tick(void) | |||
419 | ts->tick_stopped = 0; | 419 | ts->tick_stopped = 0; |
420 | ts->idle_exittime = now; | 420 | ts->idle_exittime = now; |
421 | hrtimer_cancel(&ts->sched_timer); | 421 | hrtimer_cancel(&ts->sched_timer); |
422 | ts->sched_timer.expires = ts->idle_tick; | 422 | hrtimer_set_expires(&ts->sched_timer, ts->idle_tick); |
423 | 423 | ||
424 | while (1) { | 424 | while (1) { |
425 | /* Forward the time to expire in the future */ | 425 | /* Forward the time to expire in the future */ |
426 | hrtimer_forward(&ts->sched_timer, now, tick_period); | 426 | hrtimer_forward(&ts->sched_timer, now, tick_period); |
427 | 427 | ||
428 | if (ts->nohz_mode == NOHZ_MODE_HIGHRES) { | 428 | if (ts->nohz_mode == NOHZ_MODE_HIGHRES) { |
429 | hrtimer_start(&ts->sched_timer, | 429 | hrtimer_start_expires(&ts->sched_timer, |
430 | ts->sched_timer.expires, | ||
431 | HRTIMER_MODE_ABS); | 430 | HRTIMER_MODE_ABS); |
432 | /* Check, if the timer was already in the past */ | 431 | /* Check, if the timer was already in the past */ |
433 | if (hrtimer_active(&ts->sched_timer)) | 432 | if (hrtimer_active(&ts->sched_timer)) |
434 | break; | 433 | break; |
435 | } else { | 434 | } else { |
436 | if (!tick_program_event(ts->sched_timer.expires, 0)) | 435 | if (!tick_program_event( |
436 | hrtimer_get_expires(&ts->sched_timer), 0)) | ||
437 | break; | 437 | break; |
438 | } | 438 | } |
439 | /* Update jiffies and reread time */ | 439 | /* Update jiffies and reread time */ |
@@ -446,7 +446,7 @@ void tick_nohz_restart_sched_tick(void) | |||
446 | static int tick_nohz_reprogram(struct tick_sched *ts, ktime_t now) | 446 | static int tick_nohz_reprogram(struct tick_sched *ts, ktime_t now) |
447 | { | 447 | { |
448 | hrtimer_forward(&ts->sched_timer, now, tick_period); | 448 | hrtimer_forward(&ts->sched_timer, now, tick_period); |
449 | return tick_program_event(ts->sched_timer.expires, 0); | 449 | return tick_program_event(hrtimer_get_expires(&ts->sched_timer), 0); |
450 | } | 450 | } |
451 | 451 | ||
452 | /* | 452 | /* |
@@ -529,7 +529,7 @@ static void tick_nohz_switch_to_nohz(void) | |||
529 | next = tick_init_jiffy_update(); | 529 | next = tick_init_jiffy_update(); |
530 | 530 | ||
531 | for (;;) { | 531 | for (;;) { |
532 | ts->sched_timer.expires = next; | 532 | hrtimer_set_expires(&ts->sched_timer, next); |
533 | if (!tick_program_event(next, 0)) | 533 | if (!tick_program_event(next, 0)) |
534 | break; | 534 | break; |
535 | next = ktime_add(next, tick_period); | 535 | next = ktime_add(next, tick_period); |
@@ -625,16 +625,15 @@ void tick_setup_sched_timer(void) | |||
625 | ts->sched_timer.cb_mode = HRTIMER_CB_IRQSAFE_NO_SOFTIRQ; | 625 | ts->sched_timer.cb_mode = HRTIMER_CB_IRQSAFE_NO_SOFTIRQ; |
626 | 626 | ||
627 | /* Get the next period (per cpu) */ | 627 | /* Get the next period (per cpu) */ |
628 | ts->sched_timer.expires = tick_init_jiffy_update(); | 628 | hrtimer_set_expires(&ts->sched_timer, tick_init_jiffy_update()); |
629 | offset = ktime_to_ns(tick_period) >> 1; | 629 | offset = ktime_to_ns(tick_period) >> 1; |
630 | do_div(offset, num_possible_cpus()); | 630 | do_div(offset, num_possible_cpus()); |
631 | offset *= smp_processor_id(); | 631 | offset *= smp_processor_id(); |
632 | ts->sched_timer.expires = ktime_add_ns(ts->sched_timer.expires, offset); | 632 | hrtimer_add_expires_ns(&ts->sched_timer, offset); |
633 | 633 | ||
634 | for (;;) { | 634 | for (;;) { |
635 | hrtimer_forward(&ts->sched_timer, now, tick_period); | 635 | hrtimer_forward(&ts->sched_timer, now, tick_period); |
636 | hrtimer_start(&ts->sched_timer, ts->sched_timer.expires, | 636 | hrtimer_start_expires(&ts->sched_timer, HRTIMER_MODE_ABS); |
637 | HRTIMER_MODE_ABS); | ||
638 | /* Check, if the timer was already in the past */ | 637 | /* Check, if the timer was already in the past */ |
639 | if (hrtimer_active(&ts->sched_timer)) | 638 | if (hrtimer_active(&ts->sched_timer)) |
640 | break; | 639 | break; |