aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@linux.intel.com>2008-09-01 18:02:30 -0400
committerArjan van de Ven <arjan@linux.intel.com>2008-09-06 00:35:13 -0400
commitcc584b213f252bf698849cf4be2377cd3ec7501a (patch)
tree621ba11da6a2ab8598f9ed453836cd2c44192260
parent23dd7bb09bd8d7efd8a602aed97b93d52f85e675 (diff)
hrtimer: convert kernel/* to the new hrtimer apis
In order to be able to do range hrtimers we need to use accessor functions to the "expire" member of the hrtimer struct. This patch converts kernel/* to these accessors. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
-rw-r--r--kernel/futex.c7
-rw-r--r--kernel/hrtimer.c44
-rw-r--r--kernel/posix-timers.c10
-rw-r--r--kernel/rtmutex.c3
-rw-r--r--kernel/sched.c7
-rw-r--r--kernel/time/ntp.c3
-rw-r--r--kernel/time/tick-sched.c21
-rw-r--r--kernel/time/timer_list.c4
8 files changed, 47 insertions, 52 deletions
diff --git a/kernel/futex.c b/kernel/futex.c
index 7d1136e97c14..4cd5b4319b04 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -1299,10 +1299,9 @@ static int futex_wait(u32 __user *uaddr, struct rw_semaphore *fshared,
1299 hrtimer_init_on_stack(&t.timer, CLOCK_MONOTONIC, 1299 hrtimer_init_on_stack(&t.timer, CLOCK_MONOTONIC,
1300 HRTIMER_MODE_ABS); 1300 HRTIMER_MODE_ABS);
1301 hrtimer_init_sleeper(&t, current); 1301 hrtimer_init_sleeper(&t, current);
1302 t.timer.expires = *abs_time; 1302 hrtimer_set_expires(&t.timer, *abs_time);
1303 1303
1304 hrtimer_start(&t.timer, t.timer.expires, 1304 hrtimer_start_expires(&t.timer, HRTIMER_MODE_ABS);
1305 HRTIMER_MODE_ABS);
1306 if (!hrtimer_active(&t.timer)) 1305 if (!hrtimer_active(&t.timer))
1307 t.task = NULL; 1306 t.task = NULL;
1308 1307
@@ -1404,7 +1403,7 @@ static int futex_lock_pi(u32 __user *uaddr, struct rw_semaphore *fshared,
1404 hrtimer_init_on_stack(&to->timer, CLOCK_REALTIME, 1403 hrtimer_init_on_stack(&to->timer, CLOCK_REALTIME,
1405 HRTIMER_MODE_ABS); 1404 HRTIMER_MODE_ABS);
1406 hrtimer_init_sleeper(to, current); 1405 hrtimer_init_sleeper(to, current);
1407 to->timer.expires = *time; 1406 hrtimer_set_expires(&to->timer, *time);
1408 } 1407 }
1409 1408
1410 q.pi_state = NULL; 1409 q.pi_state = NULL;
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c
index 782137dc755f..ae307feec74c 100644
--- a/kernel/hrtimer.c
+++ b/kernel/hrtimer.c
@@ -517,7 +517,7 @@ static void hrtimer_force_reprogram(struct hrtimer_cpu_base *cpu_base)
517 if (!base->first) 517 if (!base->first)
518 continue; 518 continue;
519 timer = rb_entry(base->first, struct hrtimer, node); 519 timer = rb_entry(base->first, struct hrtimer, node);
520 expires = ktime_sub(timer->expires, base->offset); 520 expires = ktime_sub(hrtimer_get_expires(timer), base->offset);
521 if (expires.tv64 < cpu_base->expires_next.tv64) 521 if (expires.tv64 < cpu_base->expires_next.tv64)
522 cpu_base->expires_next = expires; 522 cpu_base->expires_next = expires;
523 } 523 }
@@ -539,10 +539,10 @@ static int hrtimer_reprogram(struct hrtimer *timer,
539 struct hrtimer_clock_base *base) 539 struct hrtimer_clock_base *base)
540{ 540{
541 ktime_t *expires_next = &__get_cpu_var(hrtimer_bases).expires_next; 541 ktime_t *expires_next = &__get_cpu_var(hrtimer_bases).expires_next;
542 ktime_t expires = ktime_sub(timer->expires, base->offset); 542 ktime_t expires = ktime_sub(hrtimer_get_expires(timer), base->offset);
543 int res; 543 int res;
544 544
545 WARN_ON_ONCE(timer->expires.tv64 < 0); 545 WARN_ON_ONCE(hrtimer_get_expires_tv64(timer) < 0);
546 546
547 /* 547 /*
548 * When the callback is running, we do not reprogram the clock event 548 * When the callback is running, we do not reprogram the clock event
@@ -794,7 +794,7 @@ u64 hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval)
794 u64 orun = 1; 794 u64 orun = 1;
795 ktime_t delta; 795 ktime_t delta;
796 796
797 delta = ktime_sub(now, timer->expires); 797 delta = ktime_sub(now, hrtimer_get_expires(timer));
798 798
799 if (delta.tv64 < 0) 799 if (delta.tv64 < 0)
800 return 0; 800 return 0;
@@ -806,8 +806,8 @@ u64 hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval)
806 s64 incr = ktime_to_ns(interval); 806 s64 incr = ktime_to_ns(interval);
807 807
808 orun = ktime_divns(delta, incr); 808 orun = ktime_divns(delta, incr);
809 timer->expires = ktime_add_ns(timer->expires, incr * orun); 809 hrtimer_add_expires_ns(timer, incr * orun);
810 if (timer->expires.tv64 > now.tv64) 810 if (hrtimer_get_expires_tv64(timer) > now.tv64)
811 return orun; 811 return orun;
812 /* 812 /*
813 * This (and the ktime_add() below) is the 813 * This (and the ktime_add() below) is the
@@ -815,7 +815,7 @@ u64 hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval)
815 */ 815 */
816 orun++; 816 orun++;
817 } 817 }
818 timer->expires = ktime_add_safe(timer->expires, interval); 818 hrtimer_add_expires(timer, interval);
819 819
820 return orun; 820 return orun;
821} 821}
@@ -847,7 +847,8 @@ static void enqueue_hrtimer(struct hrtimer *timer,
847 * We dont care about collisions. Nodes with 847 * We dont care about collisions. Nodes with
848 * the same expiry time stay together. 848 * the same expiry time stay together.
849 */ 849 */
850 if (timer->expires.tv64 < entry->expires.tv64) { 850 if (hrtimer_get_expires_tv64(timer) <
851 hrtimer_get_expires_tv64(entry)) {
851 link = &(*link)->rb_left; 852 link = &(*link)->rb_left;
852 } else { 853 } else {
853 link = &(*link)->rb_right; 854 link = &(*link)->rb_right;
@@ -982,7 +983,7 @@ hrtimer_start(struct hrtimer *timer, ktime_t tim, const enum hrtimer_mode mode)
982#endif 983#endif
983 } 984 }
984 985
985 timer->expires = tim; 986 hrtimer_set_expires(timer, tim);
986 987
987 timer_stats_hrtimer_set_start_info(timer); 988 timer_stats_hrtimer_set_start_info(timer);
988 989
@@ -1076,7 +1077,7 @@ ktime_t hrtimer_get_remaining(const struct hrtimer *timer)
1076 ktime_t rem; 1077 ktime_t rem;
1077 1078
1078 base = lock_hrtimer_base(timer, &flags); 1079 base = lock_hrtimer_base(timer, &flags);
1079 rem = ktime_sub(timer->expires, base->get_time()); 1080 rem = hrtimer_expires_remaining(timer);
1080 unlock_hrtimer_base(timer, &flags); 1081 unlock_hrtimer_base(timer, &flags);
1081 1082
1082 return rem; 1083 return rem;
@@ -1108,7 +1109,7 @@ ktime_t hrtimer_get_next_event(void)
1108 continue; 1109 continue;
1109 1110
1110 timer = rb_entry(base->first, struct hrtimer, node); 1111 timer = rb_entry(base->first, struct hrtimer, node);
1111 delta.tv64 = timer->expires.tv64; 1112 delta.tv64 = hrtimer_get_expires_tv64(timer);
1112 delta = ktime_sub(delta, base->get_time()); 1113 delta = ktime_sub(delta, base->get_time());
1113 if (delta.tv64 < mindelta.tv64) 1114 if (delta.tv64 < mindelta.tv64)
1114 mindelta.tv64 = delta.tv64; 1115 mindelta.tv64 = delta.tv64;
@@ -1308,10 +1309,10 @@ void hrtimer_interrupt(struct clock_event_device *dev)
1308 1309
1309 timer = rb_entry(node, struct hrtimer, node); 1310 timer = rb_entry(node, struct hrtimer, node);
1310 1311
1311 if (basenow.tv64 < timer->expires.tv64) { 1312 if (basenow.tv64 < hrtimer_get_expires_tv64(timer)) {
1312 ktime_t expires; 1313 ktime_t expires;
1313 1314
1314 expires = ktime_sub(timer->expires, 1315 expires = ktime_sub(hrtimer_get_expires(timer),
1315 base->offset); 1316 base->offset);
1316 if (expires.tv64 < expires_next.tv64) 1317 if (expires.tv64 < expires_next.tv64)
1317 expires_next = expires; 1318 expires_next = expires;
@@ -1414,7 +1415,8 @@ void hrtimer_run_queues(void)
1414 struct hrtimer *timer; 1415 struct hrtimer *timer;
1415 1416
1416 timer = rb_entry(node, struct hrtimer, node); 1417 timer = rb_entry(node, struct hrtimer, node);
1417 if (base->softirq_time.tv64 <= timer->expires.tv64) 1418 if (base->softirq_time.tv64 <=
1419 hrtimer_get_expires_tv64(timer))
1418 break; 1420 break;
1419 1421
1420 if (timer->cb_mode == HRTIMER_CB_SOFTIRQ) { 1422 if (timer->cb_mode == HRTIMER_CB_SOFTIRQ) {
@@ -1462,7 +1464,7 @@ static int __sched do_nanosleep(struct hrtimer_sleeper *t, enum hrtimer_mode mod
1462 1464
1463 do { 1465 do {
1464 set_current_state(TASK_INTERRUPTIBLE); 1466 set_current_state(TASK_INTERRUPTIBLE);
1465 hrtimer_start(&t->timer, t->timer.expires, mode); 1467 hrtimer_start_expires(&t->timer, mode);
1466 if (!hrtimer_active(&t->timer)) 1468 if (!hrtimer_active(&t->timer))
1467 t->task = NULL; 1469 t->task = NULL;
1468 1470
@@ -1484,7 +1486,7 @@ static int update_rmtp(struct hrtimer *timer, struct timespec __user *rmtp)
1484 struct timespec rmt; 1486 struct timespec rmt;
1485 ktime_t rem; 1487 ktime_t rem;
1486 1488
1487 rem = ktime_sub(timer->expires, timer->base->get_time()); 1489 rem = hrtimer_expires_remaining(timer);
1488 if (rem.tv64 <= 0) 1490 if (rem.tv64 <= 0)
1489 return 0; 1491 return 0;
1490 rmt = ktime_to_timespec(rem); 1492 rmt = ktime_to_timespec(rem);
@@ -1503,7 +1505,7 @@ long __sched hrtimer_nanosleep_restart(struct restart_block *restart)
1503 1505
1504 hrtimer_init_on_stack(&t.timer, restart->nanosleep.index, 1506 hrtimer_init_on_stack(&t.timer, restart->nanosleep.index,
1505 HRTIMER_MODE_ABS); 1507 HRTIMER_MODE_ABS);
1506 t.timer.expires.tv64 = restart->nanosleep.expires; 1508 hrtimer_set_expires_tv64(&t.timer, restart->nanosleep.expires);
1507 1509
1508 if (do_nanosleep(&t, HRTIMER_MODE_ABS)) 1510 if (do_nanosleep(&t, HRTIMER_MODE_ABS))
1509 goto out; 1511 goto out;
@@ -1530,7 +1532,7 @@ long hrtimer_nanosleep(struct timespec *rqtp, struct timespec __user *rmtp,
1530 int ret = 0; 1532 int ret = 0;
1531 1533
1532 hrtimer_init_on_stack(&t.timer, clockid, mode); 1534 hrtimer_init_on_stack(&t.timer, clockid, mode);
1533 t.timer.expires = timespec_to_ktime(*rqtp); 1535 hrtimer_set_expires(&t.timer, timespec_to_ktime(*rqtp));
1534 if (do_nanosleep(&t, mode)) 1536 if (do_nanosleep(&t, mode))
1535 goto out; 1537 goto out;
1536 1538
@@ -1550,7 +1552,7 @@ long hrtimer_nanosleep(struct timespec *rqtp, struct timespec __user *rmtp,
1550 restart->fn = hrtimer_nanosleep_restart; 1552 restart->fn = hrtimer_nanosleep_restart;
1551 restart->nanosleep.index = t.timer.base->index; 1553 restart->nanosleep.index = t.timer.base->index;
1552 restart->nanosleep.rmtp = rmtp; 1554 restart->nanosleep.rmtp = rmtp;
1553 restart->nanosleep.expires = t.timer.expires.tv64; 1555 restart->nanosleep.expires = hrtimer_get_expires_tv64(&t.timer);
1554 1556
1555 ret = -ERESTART_RESTARTBLOCK; 1557 ret = -ERESTART_RESTARTBLOCK;
1556out: 1558out:
@@ -1724,11 +1726,11 @@ int __sched schedule_hrtimeout(ktime_t *expires,
1724 } 1726 }
1725 1727
1726 hrtimer_init_on_stack(&t.timer, CLOCK_MONOTONIC, mode); 1728 hrtimer_init_on_stack(&t.timer, CLOCK_MONOTONIC, mode);
1727 t.timer.expires = *expires; 1729 hrtimer_set_expires(&t.timer, *expires);
1728 1730
1729 hrtimer_init_sleeper(&t, current); 1731 hrtimer_init_sleeper(&t, current);
1730 1732
1731 hrtimer_start(&t.timer, t.timer.expires, mode); 1733 hrtimer_start_expires(&t.timer, mode);
1732 if (!hrtimer_active(&t.timer)) 1734 if (!hrtimer_active(&t.timer))
1733 t.task = NULL; 1735 t.task = NULL;
1734 1736
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c
index e36d5798cbff..f85efcdcab2d 100644
--- a/kernel/posix-timers.c
+++ b/kernel/posix-timers.c
@@ -668,7 +668,7 @@ common_timer_get(struct k_itimer *timr, struct itimerspec *cur_setting)
668 (timr->it_sigev_notify & ~SIGEV_THREAD_ID) == SIGEV_NONE)) 668 (timr->it_sigev_notify & ~SIGEV_THREAD_ID) == SIGEV_NONE))
669 timr->it_overrun += (unsigned int) hrtimer_forward(timer, now, iv); 669 timr->it_overrun += (unsigned int) hrtimer_forward(timer, now, iv);
670 670
671 remaining = ktime_sub(timer->expires, now); 671 remaining = ktime_sub(hrtimer_get_expires(timer), now);
672 /* Return 0 only, when the timer is expired and not pending */ 672 /* Return 0 only, when the timer is expired and not pending */
673 if (remaining.tv64 <= 0) { 673 if (remaining.tv64 <= 0) {
674 /* 674 /*
@@ -762,7 +762,7 @@ common_timer_set(struct k_itimer *timr, int flags,
762 hrtimer_init(&timr->it.real.timer, timr->it_clock, mode); 762 hrtimer_init(&timr->it.real.timer, timr->it_clock, mode);
763 timr->it.real.timer.function = posix_timer_fn; 763 timr->it.real.timer.function = posix_timer_fn;
764 764
765 timer->expires = timespec_to_ktime(new_setting->it_value); 765 hrtimer_set_expires(timer, timespec_to_ktime(new_setting->it_value));
766 766
767 /* Convert interval */ 767 /* Convert interval */
768 timr->it.real.interval = timespec_to_ktime(new_setting->it_interval); 768 timr->it.real.interval = timespec_to_ktime(new_setting->it_interval);
@@ -771,14 +771,12 @@ common_timer_set(struct k_itimer *timr, int flags,
771 if (((timr->it_sigev_notify & ~SIGEV_THREAD_ID) == SIGEV_NONE)) { 771 if (((timr->it_sigev_notify & ~SIGEV_THREAD_ID) == SIGEV_NONE)) {
772 /* Setup correct expiry time for relative timers */ 772 /* Setup correct expiry time for relative timers */
773 if (mode == HRTIMER_MODE_REL) { 773 if (mode == HRTIMER_MODE_REL) {
774 timer->expires = 774 hrtimer_add_expires(timer, timer->base->get_time());
775 ktime_add_safe(timer->expires,
776 timer->base->get_time());
777 } 775 }
778 return 0; 776 return 0;
779 } 777 }
780 778
781 hrtimer_start(timer, timer->expires, mode); 779 hrtimer_start_expires(timer, mode);
782 return 0; 780 return 0;
783} 781}
784 782
diff --git a/kernel/rtmutex.c b/kernel/rtmutex.c
index 6522ae5b14a2..69d9cb921ffa 100644
--- a/kernel/rtmutex.c
+++ b/kernel/rtmutex.c
@@ -631,8 +631,7 @@ rt_mutex_slowlock(struct rt_mutex *lock, int state,
631 631
632 /* Setup the timer, when timeout != NULL */ 632 /* Setup the timer, when timeout != NULL */
633 if (unlikely(timeout)) { 633 if (unlikely(timeout)) {
634 hrtimer_start(&timeout->timer, timeout->timer.expires, 634 hrtimer_start_expires(&timeout->timer, HRTIMER_MODE_ABS);
635 HRTIMER_MODE_ABS);
636 if (!hrtimer_active(&timeout->timer)) 635 if (!hrtimer_active(&timeout->timer))
637 timeout->task = NULL; 636 timeout->task = NULL;
638 } 637 }
diff --git a/kernel/sched.c b/kernel/sched.c
index 1a5f73c1fcdc..e46b5afa200d 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -221,9 +221,8 @@ static void start_rt_bandwidth(struct rt_bandwidth *rt_b)
221 221
222 now = hrtimer_cb_get_time(&rt_b->rt_period_timer); 222 now = hrtimer_cb_get_time(&rt_b->rt_period_timer);
223 hrtimer_forward(&rt_b->rt_period_timer, now, rt_b->rt_period); 223 hrtimer_forward(&rt_b->rt_period_timer, now, rt_b->rt_period);
224 hrtimer_start(&rt_b->rt_period_timer, 224 hrtimer_start_expires(&rt_b->rt_period_timer,
225 rt_b->rt_period_timer.expires, 225 HRTIMER_MODE_ABS);
226 HRTIMER_MODE_ABS);
227 } 226 }
228 spin_unlock(&rt_b->rt_runtime_lock); 227 spin_unlock(&rt_b->rt_runtime_lock);
229} 228}
@@ -1058,7 +1057,7 @@ static void hrtick_start(struct rq *rq, u64 delay)
1058 struct hrtimer *timer = &rq->hrtick_timer; 1057 struct hrtimer *timer = &rq->hrtick_timer;
1059 ktime_t time = ktime_add_ns(timer->base->get_time(), delay); 1058 ktime_t time = ktime_add_ns(timer->base->get_time(), delay);
1060 1059
1061 timer->expires = time; 1060 hrtimer_set_expires(timer, time);
1062 1061
1063 if (rq == this_rq()) { 1062 if (rq == this_rq()) {
1064 hrtimer_restart(timer); 1063 hrtimer_restart(timer);
diff --git a/kernel/time/ntp.c b/kernel/time/ntp.c
index 5125ddd8196b..4c8d85421d24 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 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)
446static int tick_nohz_reprogram(struct tick_sched *ts, ktime_t now) 446static 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;
diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c
index a40e20fd0001..5224a3215fb7 100644
--- a/kernel/time/timer_list.c
+++ b/kernel/time/timer_list.c
@@ -66,8 +66,8 @@ print_timer(struct seq_file *m, struct hrtimer *timer, int idx, u64 now)
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 nsecs [in %Ld nsecs]\n",
69 (unsigned long long)ktime_to_ns(timer->expires), 69 (unsigned long long)ktime_to_ns(hrtimer_get_expires(timer)),
70 (long long)(ktime_to_ns(timer->expires) - now)); 70 (long long)(ktime_to_ns(hrtimer_get_expires(timer)) - now));
71} 71}
72 72
73static void 73static void