diff options
Diffstat (limited to 'kernel/time')
-rw-r--r-- | kernel/time/ntp.c | 3 | ||||
-rw-r--r-- | kernel/time/tick-sched.c | 21 | ||||
-rw-r--r-- | kernel/time/timer_list.c | 8 |
3 files changed, 16 insertions, 16 deletions
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c index 1ad46f3df6e7..9c114b726ab3 100644 --- a/kernel/time/ntp.c +++ b/kernel/time/ntp.c | |||
@@ -142,8 +142,7 @@ static enum hrtimer_restart ntp_leap_second(struct hrtimer *timer) | |||
142 | time_state = TIME_OOP; | 142 | time_state = TIME_OOP; |
143 | printk(KERN_NOTICE "Clock: " | 143 | printk(KERN_NOTICE "Clock: " |
144 | "inserting leap second 23:59:60 UTC\n"); | 144 | "inserting leap second 23:59:60 UTC\n"); |
145 | leap_timer.expires = ktime_add_ns(leap_timer.expires, | 145 | hrtimer_add_expires_ns(&leap_timer, NSEC_PER_SEC); |
146 | NSEC_PER_SEC); | ||
147 | res = HRTIMER_RESTART; | 146 | res = HRTIMER_RESTART; |
148 | break; | 147 | break; |
149 | case TIME_DEL: | 148 | case TIME_DEL: |
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index b711ffcb106c..a547be11cf97 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c | |||
@@ -300,7 +300,7 @@ void tick_nohz_stop_sched_tick(int inidle) | |||
300 | goto out; | 300 | goto out; |
301 | } | 301 | } |
302 | 302 | ||
303 | ts->idle_tick = ts->sched_timer.expires; | 303 | ts->idle_tick = hrtimer_get_expires(&ts->sched_timer); |
304 | ts->tick_stopped = 1; | 304 | ts->tick_stopped = 1; |
305 | ts->idle_jiffies = last_jiffies; | 305 | ts->idle_jiffies = last_jiffies; |
306 | rcu_enter_nohz(); | 306 | rcu_enter_nohz(); |
@@ -431,21 +431,21 @@ void tick_nohz_restart_sched_tick(void) | |||
431 | ts->tick_stopped = 0; | 431 | ts->tick_stopped = 0; |
432 | ts->idle_exittime = now; | 432 | ts->idle_exittime = now; |
433 | hrtimer_cancel(&ts->sched_timer); | 433 | hrtimer_cancel(&ts->sched_timer); |
434 | ts->sched_timer.expires = ts->idle_tick; | 434 | hrtimer_set_expires(&ts->sched_timer, ts->idle_tick); |
435 | 435 | ||
436 | while (1) { | 436 | while (1) { |
437 | /* Forward the time to expire in the future */ | 437 | /* Forward the time to expire in the future */ |
438 | hrtimer_forward(&ts->sched_timer, now, tick_period); | 438 | hrtimer_forward(&ts->sched_timer, now, tick_period); |
439 | 439 | ||
440 | if (ts->nohz_mode == NOHZ_MODE_HIGHRES) { | 440 | if (ts->nohz_mode == NOHZ_MODE_HIGHRES) { |
441 | hrtimer_start(&ts->sched_timer, | 441 | hrtimer_start_expires(&ts->sched_timer, |
442 | ts->sched_timer.expires, | ||
443 | HRTIMER_MODE_ABS); | 442 | HRTIMER_MODE_ABS); |
444 | /* Check, if the timer was already in the past */ | 443 | /* Check, if the timer was already in the past */ |
445 | if (hrtimer_active(&ts->sched_timer)) | 444 | if (hrtimer_active(&ts->sched_timer)) |
446 | break; | 445 | break; |
447 | } else { | 446 | } else { |
448 | if (!tick_program_event(ts->sched_timer.expires, 0)) | 447 | if (!tick_program_event( |
448 | hrtimer_get_expires(&ts->sched_timer), 0)) | ||
449 | break; | 449 | break; |
450 | } | 450 | } |
451 | /* Update jiffies and reread time */ | 451 | /* Update jiffies and reread time */ |
@@ -458,7 +458,7 @@ void tick_nohz_restart_sched_tick(void) | |||
458 | static int tick_nohz_reprogram(struct tick_sched *ts, ktime_t now) | 458 | static int tick_nohz_reprogram(struct tick_sched *ts, ktime_t now) |
459 | { | 459 | { |
460 | hrtimer_forward(&ts->sched_timer, now, tick_period); | 460 | hrtimer_forward(&ts->sched_timer, now, tick_period); |
461 | return tick_program_event(ts->sched_timer.expires, 0); | 461 | return tick_program_event(hrtimer_get_expires(&ts->sched_timer), 0); |
462 | } | 462 | } |
463 | 463 | ||
464 | /* | 464 | /* |
@@ -541,7 +541,7 @@ static void tick_nohz_switch_to_nohz(void) | |||
541 | next = tick_init_jiffy_update(); | 541 | next = tick_init_jiffy_update(); |
542 | 542 | ||
543 | for (;;) { | 543 | for (;;) { |
544 | ts->sched_timer.expires = next; | 544 | hrtimer_set_expires(&ts->sched_timer, next); |
545 | if (!tick_program_event(next, 0)) | 545 | if (!tick_program_event(next, 0)) |
546 | break; | 546 | break; |
547 | next = ktime_add(next, tick_period); | 547 | next = ktime_add(next, tick_period); |
@@ -637,16 +637,15 @@ void tick_setup_sched_timer(void) | |||
637 | ts->sched_timer.cb_mode = HRTIMER_CB_IRQSAFE_PERCPU; | 637 | ts->sched_timer.cb_mode = HRTIMER_CB_IRQSAFE_PERCPU; |
638 | 638 | ||
639 | /* Get the next period (per cpu) */ | 639 | /* Get the next period (per cpu) */ |
640 | ts->sched_timer.expires = tick_init_jiffy_update(); | 640 | hrtimer_set_expires(&ts->sched_timer, tick_init_jiffy_update()); |
641 | offset = ktime_to_ns(tick_period) >> 1; | 641 | offset = ktime_to_ns(tick_period) >> 1; |
642 | do_div(offset, num_possible_cpus()); | 642 | do_div(offset, num_possible_cpus()); |
643 | offset *= smp_processor_id(); | 643 | offset *= smp_processor_id(); |
644 | ts->sched_timer.expires = ktime_add_ns(ts->sched_timer.expires, offset); | 644 | hrtimer_add_expires_ns(&ts->sched_timer, offset); |
645 | 645 | ||
646 | for (;;) { | 646 | for (;;) { |
647 | hrtimer_forward(&ts->sched_timer, now, tick_period); | 647 | hrtimer_forward(&ts->sched_timer, now, tick_period); |
648 | hrtimer_start(&ts->sched_timer, ts->sched_timer.expires, | 648 | hrtimer_start_expires(&ts->sched_timer, HRTIMER_MODE_ABS); |
649 | HRTIMER_MODE_ABS); | ||
650 | /* Check, if the timer was already in the past */ | 649 | /* Check, if the timer was already in the past */ |
651 | if (hrtimer_active(&ts->sched_timer)) | 650 | if (hrtimer_active(&ts->sched_timer)) |
652 | break; | 651 | break; |
diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c index a40e20fd0001..122ee751d2d1 100644 --- a/kernel/time/timer_list.c +++ b/kernel/time/timer_list.c | |||
@@ -65,9 +65,11 @@ print_timer(struct seq_file *m, struct hrtimer *timer, int idx, u64 now) | |||
65 | SEQ_printf(m, ", %s/%d", tmp, timer->start_pid); | 65 | SEQ_printf(m, ", %s/%d", tmp, timer->start_pid); |
66 | #endif | 66 | #endif |
67 | SEQ_printf(m, "\n"); | 67 | SEQ_printf(m, "\n"); |
68 | SEQ_printf(m, " # expires at %Lu nsecs [in %Ld nsecs]\n", | 68 | SEQ_printf(m, " # expires at %Lu-%Lu nsecs [in %Ld to %Ld nsecs]\n", |
69 | (unsigned long long)ktime_to_ns(timer->expires), | 69 | (unsigned long long)ktime_to_ns(hrtimer_get_softexpires(timer)), |
70 | (long long)(ktime_to_ns(timer->expires) - now)); | 70 | (unsigned long long)ktime_to_ns(hrtimer_get_expires(timer)), |
71 | (long long)(ktime_to_ns(hrtimer_get_softexpires(timer)) - now), | ||
72 | (long long)(ktime_to_ns(hrtimer_get_expires(timer)) - now)); | ||
71 | } | 73 | } |
72 | 74 | ||
73 | static void | 75 | static void |