Lines Matching full:timer

9  *  In contrast to the low-resolution timeout API, aka timer wheel,
16 * Based on the original timer wheel code
42 #include <linux/timer.h>
48 #include <trace/events/timer.h>
64 * The timer bases:
67 * into the timer bases by the hrtimer_base_type enum. When trying
147 * timer->base->cpu_base
161 * means that all timers which are tied to this base via timer->base are
167 * When the timer's base is locked, and the timer removed from list, it is
168 * possible to set timer->base = &migration_base and drop the lock: the timer
172 struct hrtimer_clock_base *lock_hrtimer_base(const struct hrtimer *timer, in lock_hrtimer_base() argument
174 __acquires(&timer->base->lock) in lock_hrtimer_base()
179 base = READ_ONCE(timer->base); in lock_hrtimer_base()
182 if (likely(base == timer->base)) in lock_hrtimer_base()
184 /* The timer has migrated to another CPU: */ in lock_hrtimer_base()
195 * If the elected target is remote and its next event is after the timer
205 static bool hrtimer_suitable_target(struct hrtimer *timer, struct hrtimer_clock_base *new_base, in hrtimer_suitable_target() argument
220 * next remote target event is after this timer. Keep the in hrtimer_suitable_target()
227 expires = ktime_sub(hrtimer_get_expires(timer), new_base->offset); in hrtimer_suitable_target()
248 * We switch the timer base to a power-optimized selected CPU target,
251 * - timer migration is enabled
252 * - the timer callback is not running
253 * - the timer is not the first expiring timer on the new target
255 * If one of the above requirements is not fulfilled we move the timer
257 * the timer callback is currently running.
260 switch_hrtimer_base(struct hrtimer *timer, struct hrtimer_clock_base *base, in switch_hrtimer_base() argument
274 * We are trying to move timer to new_base. in switch_hrtimer_base()
275 * However we can't change timer's base while it is running, in switch_hrtimer_base()
278 * code will take care of this when the timer function has in switch_hrtimer_base()
280 * the timer is enqueued. in switch_hrtimer_base()
282 if (unlikely(hrtimer_callback_running(timer))) in switch_hrtimer_base()
286 WRITE_ONCE(timer->base, &migration_base); in switch_hrtimer_base()
290 if (!hrtimer_suitable_target(timer, new_base, new_cpu_base, in switch_hrtimer_base()
295 WRITE_ONCE(timer->base, base); in switch_hrtimer_base()
298 WRITE_ONCE(timer->base, new_base); in switch_hrtimer_base()
300 if (!hrtimer_suitable_target(timer, new_base, new_cpu_base, this_cpu_base)) { in switch_hrtimer_base()
311 lock_hrtimer_base(const struct hrtimer *timer, unsigned long *flags) in lock_hrtimer_base() argument
312 __acquires(&timer->base->cpu_base->lock) in lock_hrtimer_base()
314 struct hrtimer_clock_base *base = timer->base; in lock_hrtimer_base()
388 struct hrtimer *timer = addr; in hrtimer_fixup_init() local
392 hrtimer_cancel(timer); in hrtimer_fixup_init()
393 debug_object_init(timer, &hrtimer_debug_descr); in hrtimer_fixup_init()
422 struct hrtimer *timer = addr; in hrtimer_fixup_free() local
426 hrtimer_cancel(timer); in hrtimer_fixup_free()
427 debug_object_free(timer, &hrtimer_debug_descr); in hrtimer_fixup_free()
442 static inline void debug_hrtimer_init(struct hrtimer *timer) in debug_hrtimer_init() argument
444 debug_object_init(timer, &hrtimer_debug_descr); in debug_hrtimer_init()
447 static inline void debug_hrtimer_init_on_stack(struct hrtimer *timer) in debug_hrtimer_init_on_stack() argument
449 debug_object_init_on_stack(timer, &hrtimer_debug_descr); in debug_hrtimer_init_on_stack()
452 static inline void debug_hrtimer_activate(struct hrtimer *timer, in debug_hrtimer_activate() argument
455 debug_object_activate(timer, &hrtimer_debug_descr); in debug_hrtimer_activate()
458 static inline void debug_hrtimer_deactivate(struct hrtimer *timer) in debug_hrtimer_deactivate() argument
460 debug_object_deactivate(timer, &hrtimer_debug_descr); in debug_hrtimer_deactivate()
463 void destroy_hrtimer_on_stack(struct hrtimer *timer) in destroy_hrtimer_on_stack() argument
465 debug_object_free(timer, &hrtimer_debug_descr); in destroy_hrtimer_on_stack()
471 static inline void debug_hrtimer_init(struct hrtimer *timer) { } in debug_hrtimer_init() argument
472 static inline void debug_hrtimer_init_on_stack(struct hrtimer *timer) { } in debug_hrtimer_init_on_stack() argument
473 static inline void debug_hrtimer_activate(struct hrtimer *timer, in debug_hrtimer_activate() argument
475 static inline void debug_hrtimer_deactivate(struct hrtimer *timer) { } in debug_hrtimer_deactivate() argument
479 debug_init(struct hrtimer *timer, clockid_t clockid, in debug_init() argument
482 debug_hrtimer_init(timer); in debug_init()
483 trace_hrtimer_init(timer, clockid, mode); in debug_init()
486 static inline void debug_init_on_stack(struct hrtimer *timer, clockid_t clockid, in debug_init_on_stack() argument
489 debug_hrtimer_init_on_stack(timer); in debug_init_on_stack()
490 trace_hrtimer_init(timer, clockid, mode); in debug_init_on_stack()
493 static inline void debug_activate(struct hrtimer *timer, in debug_activate() argument
496 debug_hrtimer_activate(timer, mode); in debug_activate()
497 trace_hrtimer_start(timer, mode); in debug_activate()
500 static inline void debug_deactivate(struct hrtimer *timer) in debug_deactivate() argument
502 debug_hrtimer_deactivate(timer); in debug_deactivate()
503 trace_hrtimer_cancel(timer); in debug_deactivate()
533 struct hrtimer *timer; in __hrtimer_next_event_base() local
536 timer = container_of(next, struct hrtimer, node); in __hrtimer_next_event_base()
537 if (timer == exclude) { in __hrtimer_next_event_base()
538 /* Get to the next timer in the queue. */ in __hrtimer_next_event_base()
543 timer = container_of(next, struct hrtimer, node); in __hrtimer_next_event_base()
545 expires = ktime_sub(hrtimer_get_expires(timer), base->offset); in __hrtimer_next_event_base()
549 /* Skip cpu_base update if a timer is being excluded. */ in __hrtimer_next_event_base()
553 if (timer->is_soft) in __hrtimer_next_event_base()
554 cpu_base->softirq_next_timer = timer; in __hrtimer_next_event_base()
556 cpu_base->next_timer = timer; in __hrtimer_next_event_base()
635 * If a softirq timer is expiring first, update cpu_base->next_timer in hrtimer_update_next_event()
681 * If a hang was detected in the last timer interrupt then we in __hrtimer_reprogram()
718 /* High resolution timer related functions */
722 * High resolution timer enabled ?
794 * If high resolution mode is active then the next expiring timer in retrigger_next_event()
799 * of the next expiring timer is enough. The return from the SMP in retrigger_next_event()
816 * When a timer is enqueued and expires earlier than the already enqueued
817 * timers, we have to check, whether it expires earlier than the timer for
822 static void hrtimer_reprogram(struct hrtimer *timer, bool reprogram) in hrtimer_reprogram() argument
825 struct hrtimer_clock_base *base = timer->base; in hrtimer_reprogram()
826 ktime_t expires = ktime_sub(hrtimer_get_expires(timer), base->offset); in hrtimer_reprogram()
828 WARN_ON_ONCE(hrtimer_get_expires_tv64(timer) < 0); in hrtimer_reprogram()
831 * CLOCK_REALTIME timer might be requested with an absolute in hrtimer_reprogram()
837 if (timer->is_soft) { in hrtimer_reprogram()
853 timer_cpu_base->softirq_next_timer = timer; in hrtimer_reprogram()
862 * If the timer is not on the current cpu, we cannot reprogram in hrtimer_reprogram()
878 cpu_base->next_timer = timer; in hrtimer_reprogram()
880 __hrtimer_reprogram(cpu_base, timer, expires); in hrtimer_reprogram()
898 * the next expiring timer. in update_needs_ipi()
912 * will reevaluate the first expiring timer of all clock bases in update_needs_ipi()
920 * timer in a clock base is moving ahead of the first expiring timer of in update_needs_ipi()
952 * when the change moves an affected timer ahead of the first expiring
953 * timer on that CPU. Obviously remote per CPU clock event devices cannot
1029 void unlock_hrtimer_base(const struct hrtimer *timer, unsigned long *flags) in unlock_hrtimer_base() argument
1030 __releases(&timer->base->cpu_base->lock) in unlock_hrtimer_base()
1032 raw_spin_unlock_irqrestore(&timer->base->cpu_base->lock, *flags); in unlock_hrtimer_base()
1036 * hrtimer_forward() - forward the timer expiry
1037 * @timer: hrtimer to forward
1041 * Forward the timer expiry so it will expire in the future.
1044 * This only updates the timer expiry value and does not requeue the timer.
1048 * Context: Can be safely called from the callback function of @timer. If called
1049 * from other contexts @timer must neither be enqueued nor running the
1054 u64 hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval) in hrtimer_forward() argument
1059 delta = ktime_sub(now, hrtimer_get_expires(timer)); in hrtimer_forward()
1064 if (WARN_ON(timer->state & HRTIMER_STATE_ENQUEUED)) in hrtimer_forward()
1074 hrtimer_add_expires_ns(timer, incr * orun); in hrtimer_forward()
1075 if (hrtimer_get_expires_tv64(timer) > now) in hrtimer_forward()
1083 hrtimer_add_expires(timer, interval); in hrtimer_forward()
1090 * enqueue_hrtimer - internal function to (re)start a timer
1092 * The timer is inserted in expiry order. Insertion into the
1095 * Returns true when the new timer is the leftmost timer in the tree.
1097 static bool enqueue_hrtimer(struct hrtimer *timer, struct hrtimer_clock_base *base, in enqueue_hrtimer() argument
1100 debug_activate(timer, mode); in enqueue_hrtimer()
1106 WRITE_ONCE(timer->state, HRTIMER_STATE_ENQUEUED); in enqueue_hrtimer()
1108 return timerqueue_add(&base->active, &timer->node); in enqueue_hrtimer()
1112 * __remove_hrtimer - internal function to remove a timer
1116 * High resolution timer mode reprograms the clock event device when the
1117 * timer is the one which expires next. The caller can disable this by setting
1119 * anyway (e.g. timer interrupt)
1121 static void __remove_hrtimer(struct hrtimer *timer, in __remove_hrtimer() argument
1126 u8 state = timer->state; in __remove_hrtimer()
1129 WRITE_ONCE(timer->state, newstate); in __remove_hrtimer()
1133 if (!timerqueue_del(&base->active, &timer->node)) in __remove_hrtimer()
1139 * timer on a remote cpu. No harm as we never dereference in __remove_hrtimer()
1142 * remote cpu later on if the same timer gets enqueued again. in __remove_hrtimer()
1144 if (reprogram && timer == cpu_base->next_timer) in __remove_hrtimer()
1152 remove_hrtimer(struct hrtimer *timer, struct hrtimer_clock_base *base, in remove_hrtimer() argument
1155 u8 state = timer->state; in remove_hrtimer()
1161 * Remove the timer and force reprogramming when high in remove_hrtimer()
1162 * resolution mode is active and the timer is on the current in remove_hrtimer()
1163 * CPU. If we remove a timer on another CPU, reprogramming is in remove_hrtimer()
1168 debug_deactivate(timer); in remove_hrtimer()
1172 * If the timer is not restarted then reprogramming is in remove_hrtimer()
1173 * required if the timer is local. If it is local and about in remove_hrtimer()
1182 __remove_hrtimer(timer, base, state, reprogram); in remove_hrtimer()
1188 static inline ktime_t hrtimer_update_lowres(struct hrtimer *timer, ktime_t tim, in hrtimer_update_lowres() argument
1197 timer->is_rel = mode & HRTIMER_MODE_REL; in hrtimer_update_lowres()
1198 if (timer->is_rel) in hrtimer_update_lowres()
1229 static int __hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, in __hrtimer_start_range_ns() argument
1238 * If the timer is on the local cpu base and is the first expiring in __hrtimer_start_range_ns()
1239 * timer then this might end up reprogramming the hardware twice in __hrtimer_start_range_ns()
1241 * reprogram on removal, keep the timer local to the current CPU in __hrtimer_start_range_ns()
1243 * it is the new first expiring timer again or not. in __hrtimer_start_range_ns()
1246 force_local &= base->cpu_base->next_timer == timer; in __hrtimer_start_range_ns()
1255 * Remove an active timer from the queue. In case it is not queued in __hrtimer_start_range_ns()
1259 * If it's on the current CPU and the first expiring timer, then in __hrtimer_start_range_ns()
1260 * skip reprogramming, keep the timer local and enforce in __hrtimer_start_range_ns()
1261 * reprogramming later if it was the first expiring timer. This in __hrtimer_start_range_ns()
1265 remove_hrtimer(timer, base, true, force_local); in __hrtimer_start_range_ns()
1270 tim = hrtimer_update_lowres(timer, tim, mode); in __hrtimer_start_range_ns()
1272 hrtimer_set_expires_range_ns(timer, tim, delta_ns); in __hrtimer_start_range_ns()
1274 /* Switch the timer base, if necessary: */ in __hrtimer_start_range_ns()
1276 new_base = switch_hrtimer_base(timer, base, in __hrtimer_start_range_ns()
1282 first = enqueue_hrtimer(timer, new_base, mode); in __hrtimer_start_range_ns()
1285 * If the current CPU base is online, then the timer is in __hrtimer_start_range_ns()
1287 * expiring timer there. in __hrtimer_start_range_ns()
1293 * Timer was enqueued remote because the current base is in __hrtimer_start_range_ns()
1294 * already offline. If the timer is the first to expire, in __hrtimer_start_range_ns()
1306 * Timer was forced to stay on the current CPU to avoid in __hrtimer_start_range_ns()
1308 * hardware by evaluating the new first expiring timer. in __hrtimer_start_range_ns()
1316 * @timer: the timer to be added
1318 * @delta_ns: "slack" range for the timer
1319 * @mode: timer mode: absolute (HRTIMER_MODE_ABS) or
1323 void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, in hrtimer_start_range_ns() argument
1329 if (WARN_ON_ONCE(!timer->function)) in hrtimer_start_range_ns()
1337 WARN_ON_ONCE(!(mode & HRTIMER_MODE_SOFT) ^ !timer->is_soft); in hrtimer_start_range_ns()
1339 WARN_ON_ONCE(!(mode & HRTIMER_MODE_HARD) ^ !timer->is_hard); in hrtimer_start_range_ns()
1341 base = lock_hrtimer_base(timer, &flags); in hrtimer_start_range_ns()
1343 if (__hrtimer_start_range_ns(timer, tim, delta_ns, mode, base)) in hrtimer_start_range_ns()
1344 hrtimer_reprogram(timer, true); in hrtimer_start_range_ns()
1346 unlock_hrtimer_base(timer, &flags); in hrtimer_start_range_ns()
1351 * hrtimer_try_to_cancel - try to deactivate a timer
1352 * @timer: hrtimer to stop
1356 * * 0 when the timer was not active
1357 * * 1 when the timer was active
1358 * * -1 when the timer is currently executing the callback function and
1361 int hrtimer_try_to_cancel(struct hrtimer *timer) in hrtimer_try_to_cancel() argument
1368 * Check lockless first. If the timer is not active (neither in hrtimer_try_to_cancel()
1373 if (!hrtimer_active(timer)) in hrtimer_try_to_cancel()
1376 base = lock_hrtimer_base(timer, &flags); in hrtimer_try_to_cancel()
1378 if (!hrtimer_callback_running(timer)) in hrtimer_try_to_cancel()
1379 ret = remove_hrtimer(timer, base, false, false); in hrtimer_try_to_cancel()
1381 unlock_hrtimer_base(timer, &flags); in hrtimer_try_to_cancel()
1410 * the timer callback to finish. Drop expiry_lock and reacquire it. That
1438 * deletion of a timer failed because the timer callback function was
1442 * in the middle of a timer callback, then calling del_timer_sync() can
1445 * - If the caller is on a remote CPU then it has to spin wait for the timer
1448 * - If the caller originates from the task which preempted the timer
1449 * handler on the same CPU, then spin waiting for the timer handler to
1452 void hrtimer_cancel_wait_running(const struct hrtimer *timer) in hrtimer_cancel_wait_running() argument
1455 struct hrtimer_clock_base *base = READ_ONCE(timer->base); in hrtimer_cancel_wait_running()
1458 * Just relax if the timer expires in hard interrupt context or if in hrtimer_cancel_wait_running()
1461 if (!timer->is_soft || is_migration_base(base)) { in hrtimer_cancel_wait_running()
1468 * held by the softirq across the timer callback. Drop the lock in hrtimer_cancel_wait_running()
1469 * immediately so the softirq can expire the next timer. In theory in hrtimer_cancel_wait_running()
1470 * the timer could already be running again, but that's more than in hrtimer_cancel_wait_running()
1490 * hrtimer_cancel - cancel a timer and wait for the handler to finish.
1491 * @timer: the timer to be cancelled
1494 * 0 when the timer was not active
1495 * 1 when the timer was active
1497 int hrtimer_cancel(struct hrtimer *timer) in hrtimer_cancel() argument
1502 ret = hrtimer_try_to_cancel(timer); in hrtimer_cancel()
1505 hrtimer_cancel_wait_running(timer); in hrtimer_cancel()
1512 * __hrtimer_get_remaining - get remaining time for the timer
1513 * @timer: the timer to read
1516 ktime_t __hrtimer_get_remaining(const struct hrtimer *timer, bool adjust) in __hrtimer_get_remaining() argument
1521 lock_hrtimer_base(timer, &flags); in __hrtimer_get_remaining()
1523 rem = hrtimer_expires_remaining_adjusted(timer); in __hrtimer_get_remaining()
1525 rem = hrtimer_expires_remaining(timer); in __hrtimer_get_remaining()
1526 unlock_hrtimer_base(timer, &flags); in __hrtimer_get_remaining()
1536 * Returns the next expiry time or KTIME_MAX if no timer is pending.
1555 * hrtimer_next_event_without - time until next expiry event w/o one timer
1556 * @exclude: timer to exclude
1605 static void __hrtimer_init(struct hrtimer *timer, clockid_t clock_id, in __hrtimer_init() argument
1621 memset(timer, 0, sizeof(struct hrtimer)); in __hrtimer_init()
1635 timer->is_soft = softtimer; in __hrtimer_init()
1636 timer->is_hard = !!(mode & HRTIMER_MODE_HARD); in __hrtimer_init()
1637 timer->base = &cpu_base->clock_base[base]; in __hrtimer_init()
1638 timerqueue_init(&timer->node); in __hrtimer_init()
1641 static void __hrtimer_setup(struct hrtimer *timer, in __hrtimer_setup() argument
1645 __hrtimer_init(timer, clock_id, mode); in __hrtimer_setup()
1648 timer->function = hrtimer_dummy_timeout; in __hrtimer_setup()
1650 timer->function = function; in __hrtimer_setup()
1654 * hrtimer_init - initialize a timer to the given clock
1655 * @timer: the timer to be initialized
1665 void hrtimer_init(struct hrtimer *timer, clockid_t clock_id, in hrtimer_init() argument
1668 debug_init(timer, clock_id, mode); in hrtimer_init()
1669 __hrtimer_init(timer, clock_id, mode); in hrtimer_init()
1674 * hrtimer_setup - initialize a timer to the given clock
1675 * @timer: the timer to be initialized
1686 void hrtimer_setup(struct hrtimer *timer, enum hrtimer_restart (*function)(struct hrtimer *), in hrtimer_setup() argument
1689 debug_init(timer, clock_id, mode); in hrtimer_setup()
1690 __hrtimer_setup(timer, function, clock_id, mode); in hrtimer_setup()
1695 * hrtimer_setup_on_stack - initialize a timer on stack memory
1696 * @timer: The timer to be initialized
1699 * @mode: The timer mode
1704 void hrtimer_setup_on_stack(struct hrtimer *timer, in hrtimer_setup_on_stack() argument
1708 debug_init_on_stack(timer, clock_id, mode); in hrtimer_setup_on_stack()
1709 __hrtimer_setup(timer, function, clock_id, mode); in hrtimer_setup_on_stack()
1714 * A timer is active, when it is enqueued into the rbtree or the
1720 bool hrtimer_active(const struct hrtimer *timer) in hrtimer_active() argument
1726 base = READ_ONCE(timer->base); in hrtimer_active()
1729 if (timer->state != HRTIMER_STATE_INACTIVE || in hrtimer_active()
1730 base->running == timer) in hrtimer_active()
1734 base != READ_ONCE(timer->base)); in hrtimer_active()
1744 * - queued: the timer is queued
1745 * - callback: the timer is being ran
1746 * - post: the timer is inactive or (re)queued
1748 * On the read side we ensure we observe timer->state and cpu_base->running
1750 * This includes timer->base changing because sequence numbers alone are
1760 struct hrtimer *timer, ktime_t *now, in __run_hrtimer() argument
1769 debug_deactivate(timer); in __run_hrtimer()
1770 base->running = timer; in __run_hrtimer()
1777 * timer->state == INACTIVE. in __run_hrtimer()
1781 __remove_hrtimer(timer, base, HRTIMER_STATE_INACTIVE, 0); in __run_hrtimer()
1782 fn = timer->function; in __run_hrtimer()
1786 * timer is restarted with a period then it becomes an absolute in __run_hrtimer()
1787 * timer. If its not restarted it does not matter. in __run_hrtimer()
1790 timer->is_rel = false; in __run_hrtimer()
1793 * The timer is marked as running in the CPU base, so it is in __run_hrtimer()
1798 trace_hrtimer_expire_entry(timer, now); in __run_hrtimer()
1799 expires_in_hardirq = lockdep_hrtimer_enter(timer); in __run_hrtimer()
1801 restart = fn(timer); in __run_hrtimer()
1804 trace_hrtimer_expire_exit(timer); in __run_hrtimer()
1813 * hrtimer_start_range_ns() can have popped in and enqueued the timer in __run_hrtimer()
1817 !(timer->state & HRTIMER_STATE_ENQUEUED)) in __run_hrtimer()
1818 enqueue_hrtimer(timer, base, HRTIMER_MODE_ABS); in __run_hrtimer()
1824 * hrtimer_active() cannot observe base->running.timer == NULL && in __run_hrtimer()
1825 * timer->state == INACTIVE. in __run_hrtimer()
1829 WARN_ON_ONCE(base->running != timer); in __run_hrtimer()
1846 struct hrtimer *timer; in __hrtimer_run_queues() local
1848 timer = container_of(node, struct hrtimer, node); in __hrtimer_run_queues()
1859 * are right-of a not yet expired timer, because that in __hrtimer_run_queues()
1860 * timer will have to trigger a wakeup anyway. in __hrtimer_run_queues()
1862 if (basenow < hrtimer_get_softexpires_tv64(timer)) in __hrtimer_run_queues()
1865 __run_hrtimer(cpu_base, base, timer, &basenow, flags); in __hrtimer_run_queues()
1894 * High resolution timer interrupt
1914 * held to prevent that a timer is enqueued in our queue via in hrtimer_interrupt()
1946 * The next timer was already expired due to: in hrtimer_interrupt()
2029 static enum hrtimer_restart hrtimer_wakeup(struct hrtimer *timer) in hrtimer_wakeup() argument
2032 container_of(timer, struct hrtimer_sleeper, timer); in hrtimer_wakeup()
2043 * hrtimer_sleeper_start_expires - Start a hrtimer sleeper timer
2045 * @mode: timer mode abs/rel
2060 if (IS_ENABLED(CONFIG_PREEMPT_RT) && sl->timer.is_hard) in hrtimer_sleeper_start_expires()
2063 hrtimer_start_expires(&sl->timer, mode); in hrtimer_sleeper_start_expires()
2094 __hrtimer_init(&sl->timer, clock_id, mode); in __hrtimer_init_sleeper()
2095 sl->timer.function = hrtimer_wakeup; in __hrtimer_init_sleeper()
2103 * @mode: timer mode abs/rel
2108 debug_init_on_stack(&sl->timer, clock_id, mode); in hrtimer_setup_sleeper_on_stack()
2143 hrtimer_cancel(&t->timer); in do_nanosleep()
2155 ktime_t rem = hrtimer_expires_remaining(&t->timer); in do_nanosleep()
2173 hrtimer_set_expires_tv64(&t.timer, restart->nanosleep.expires); in hrtimer_nanosleep_restart()
2175 destroy_hrtimer_on_stack(&t.timer); in hrtimer_nanosleep_restart()
2187 hrtimer_set_expires_range_ns(&t.timer, rqtp, current->timer_slack_ns); in hrtimer_nanosleep()
2199 restart->nanosleep.clockid = t.timer.base->clockid; in hrtimer_nanosleep()
2200 restart->nanosleep.expires = hrtimer_get_expires_tv64(&t.timer); in hrtimer_nanosleep()
2203 destroy_hrtimer_on_stack(&t.timer); in hrtimer_nanosleep()
2292 struct hrtimer *timer; in migrate_hrtimer_list() local
2296 timer = container_of(node, struct hrtimer, node); in migrate_hrtimer_list()
2297 BUG_ON(hrtimer_callback_running(timer)); in migrate_hrtimer_list()
2298 debug_deactivate(timer); in migrate_hrtimer_list()
2302 * timer could be seen as !active and just vanish away in migrate_hrtimer_list()
2305 __remove_hrtimer(timer, old_base, HRTIMER_STATE_ENQUEUED, 0); in migrate_hrtimer_list()
2306 timer->base = new_base; in migrate_hrtimer_list()
2309 * reprogram the event device in case the timer in migrate_hrtimer_list()
2315 enqueue_hrtimer(timer, new_base, HRTIMER_MODE_ABS); in migrate_hrtimer_list()
2341 * timer on this CPU. Update it. in hrtimers_cpu_dying()