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>
55 * idea of the (in)accuracy of timers. Timer values are rounded up to
73 * The timer bases:
76 * into the timer bases by the hrtimer_base_type enum. When trying
138 * timer->base->cpu_base
152 * means that all timers which are tied to this base via timer->base are
158 * When the timer's base is locked, and the timer removed from list, it is
159 * possible to set timer->base = &migration_base and drop the lock: the timer
163 struct hrtimer_clock_base *lock_hrtimer_base(const struct hrtimer *timer, in lock_hrtimer_base() argument
165 __acquires(&timer->base->lock) in lock_hrtimer_base()
170 base = READ_ONCE(timer->base); in lock_hrtimer_base()
173 if (likely(base == timer->base)) in lock_hrtimer_base()
175 /* The timer has migrated to another CPU: */ in lock_hrtimer_base()
186 * If the elected target is remote and its next event is after the timer
196 static bool hrtimer_suitable_target(struct hrtimer *timer, struct hrtimer_clock_base *new_base, in hrtimer_suitable_target() argument
211 * next remote target event is after this timer. Keep the in hrtimer_suitable_target()
218 expires = ktime_sub(hrtimer_get_expires(timer), new_base->offset); in hrtimer_suitable_target()
239 * We switch the timer base to a power-optimized selected CPU target,
242 * - timer migration is enabled
243 * - the timer callback is not running
244 * - the timer is not the first expiring timer on the new target
246 * If one of the above requirements is not fulfilled we move the timer
248 * the timer callback is currently running.
251 switch_hrtimer_base(struct hrtimer *timer, struct hrtimer_clock_base *base, in switch_hrtimer_base() argument
265 * We are trying to move timer to new_base. in switch_hrtimer_base()
266 * However we can't change timer's base while it is running, in switch_hrtimer_base()
269 * code will take care of this when the timer function has in switch_hrtimer_base()
271 * the timer is enqueued. in switch_hrtimer_base()
273 if (unlikely(hrtimer_callback_running(timer))) in switch_hrtimer_base()
277 WRITE_ONCE(timer->base, &migration_base); in switch_hrtimer_base()
281 if (!hrtimer_suitable_target(timer, new_base, new_cpu_base, in switch_hrtimer_base()
286 WRITE_ONCE(timer->base, base); in switch_hrtimer_base()
289 WRITE_ONCE(timer->base, new_base); in switch_hrtimer_base()
291 if (!hrtimer_suitable_target(timer, new_base, new_cpu_base, this_cpu_base)) { in switch_hrtimer_base()
302 lock_hrtimer_base(const struct hrtimer *timer, unsigned long *flags) in lock_hrtimer_base() argument
303 __acquires(&timer->base->cpu_base->lock) in lock_hrtimer_base()
305 struct hrtimer_clock_base *base = timer->base; in lock_hrtimer_base()
379 struct hrtimer *timer = addr; in hrtimer_fixup_init() local
383 hrtimer_cancel(timer); in hrtimer_fixup_init()
384 debug_object_init(timer, &hrtimer_debug_descr); in hrtimer_fixup_init()
413 struct hrtimer *timer = addr; in hrtimer_fixup_free() local
417 hrtimer_cancel(timer); in hrtimer_fixup_free()
418 debug_object_free(timer, &hrtimer_debug_descr); in hrtimer_fixup_free()
433 static inline void debug_hrtimer_init(struct hrtimer *timer) in debug_hrtimer_init() argument
435 debug_object_init(timer, &hrtimer_debug_descr); in debug_hrtimer_init()
438 static inline void debug_hrtimer_init_on_stack(struct hrtimer *timer) in debug_hrtimer_init_on_stack() argument
440 debug_object_init_on_stack(timer, &hrtimer_debug_descr); in debug_hrtimer_init_on_stack()
443 static inline void debug_hrtimer_activate(struct hrtimer *timer, in debug_hrtimer_activate() argument
446 debug_object_activate(timer, &hrtimer_debug_descr); in debug_hrtimer_activate()
449 static inline void debug_hrtimer_deactivate(struct hrtimer *timer) in debug_hrtimer_deactivate() argument
451 debug_object_deactivate(timer, &hrtimer_debug_descr); in debug_hrtimer_deactivate()
454 void destroy_hrtimer_on_stack(struct hrtimer *timer) in destroy_hrtimer_on_stack() argument
456 debug_object_free(timer, &hrtimer_debug_descr); in destroy_hrtimer_on_stack()
462 static inline void debug_hrtimer_init(struct hrtimer *timer) { } in debug_hrtimer_init() argument
463 static inline void debug_hrtimer_init_on_stack(struct hrtimer *timer) { } in debug_hrtimer_init_on_stack() argument
464 static inline void debug_hrtimer_activate(struct hrtimer *timer, in debug_hrtimer_activate() argument
466 static inline void debug_hrtimer_deactivate(struct hrtimer *timer) { } in debug_hrtimer_deactivate() argument
469 static inline void debug_setup(struct hrtimer *timer, clockid_t clockid, enum hrtimer_mode mode) in debug_setup() argument
471 debug_hrtimer_init(timer); in debug_setup()
472 trace_hrtimer_setup(timer, clockid, mode); in debug_setup()
475 static inline void debug_setup_on_stack(struct hrtimer *timer, clockid_t clockid, in debug_setup_on_stack() argument
478 debug_hrtimer_init_on_stack(timer); in debug_setup_on_stack()
479 trace_hrtimer_setup(timer, clockid, mode); in debug_setup_on_stack()
482 static inline void debug_activate(struct hrtimer *timer, in debug_activate() argument
485 debug_hrtimer_activate(timer, mode); in debug_activate()
486 trace_hrtimer_start(timer, mode); in debug_activate()
489 static inline void debug_deactivate(struct hrtimer *timer) in debug_deactivate() argument
491 debug_hrtimer_deactivate(timer); in debug_deactivate()
492 trace_hrtimer_cancel(timer); in debug_deactivate()
522 struct hrtimer *timer; in __hrtimer_next_event_base() local
525 timer = container_of(next, struct hrtimer, node); in __hrtimer_next_event_base()
526 if (timer == exclude) { in __hrtimer_next_event_base()
527 /* Get to the next timer in the queue. */ in __hrtimer_next_event_base()
532 timer = container_of(next, struct hrtimer, node); in __hrtimer_next_event_base()
534 expires = ktime_sub(hrtimer_get_expires(timer), base->offset); in __hrtimer_next_event_base()
538 /* Skip cpu_base update if a timer is being excluded. */ in __hrtimer_next_event_base()
542 if (timer->is_soft) in __hrtimer_next_event_base()
543 cpu_base->softirq_next_timer = timer; in __hrtimer_next_event_base()
545 cpu_base->next_timer = timer; in __hrtimer_next_event_base()
624 * If a softirq timer is expiring first, update cpu_base->next_timer in hrtimer_update_next_event()
670 * If a hang was detected in the last timer interrupt then we in __hrtimer_reprogram()
707 /* High resolution timer related functions */
711 * High resolution timer enabled ?
783 * If high resolution mode is active then the next expiring timer in retrigger_next_event()
788 * of the next expiring timer is enough. The return from the SMP in retrigger_next_event()
805 * When a timer is enqueued and expires earlier than the already enqueued
806 * timers, we have to check, whether it expires earlier than the timer for
811 static void hrtimer_reprogram(struct hrtimer *timer, bool reprogram) in hrtimer_reprogram() argument
814 struct hrtimer_clock_base *base = timer->base; in hrtimer_reprogram()
815 ktime_t expires = ktime_sub(hrtimer_get_expires(timer), base->offset); in hrtimer_reprogram()
817 WARN_ON_ONCE(hrtimer_get_expires(timer) < 0); in hrtimer_reprogram()
820 * CLOCK_REALTIME timer might be requested with an absolute in hrtimer_reprogram()
826 if (timer->is_soft) { in hrtimer_reprogram()
842 timer_cpu_base->softirq_next_timer = timer; in hrtimer_reprogram()
851 * If the timer is not on the current cpu, we cannot reprogram in hrtimer_reprogram()
867 cpu_base->next_timer = timer; in hrtimer_reprogram()
869 __hrtimer_reprogram(cpu_base, timer, expires); in hrtimer_reprogram()
887 * the next expiring timer. in update_needs_ipi()
901 * will reevaluate the first expiring timer of all clock bases in update_needs_ipi()
909 * timer in a clock base is moving ahead of the first expiring timer of in update_needs_ipi()
941 * when the change moves an affected timer ahead of the first expiring
942 * timer on that CPU. Obviously remote per CPU clock event devices cannot
1018 void unlock_hrtimer_base(const struct hrtimer *timer, unsigned long *flags) in unlock_hrtimer_base() argument
1019 __releases(&timer->base->cpu_base->lock) in unlock_hrtimer_base()
1021 raw_spin_unlock_irqrestore(&timer->base->cpu_base->lock, *flags); in unlock_hrtimer_base()
1025 * hrtimer_forward() - forward the timer expiry
1026 * @timer: hrtimer to forward
1030 * Forward the timer expiry so it will expire in the future.
1033 * This only updates the timer expiry value and does not requeue the timer.
1037 * Context: Can be safely called from the callback function of @timer. If called
1038 * from other contexts @timer must neither be enqueued nor running the
1043 u64 hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval) in hrtimer_forward() argument
1048 delta = ktime_sub(now, hrtimer_get_expires(timer)); in hrtimer_forward()
1053 if (WARN_ON(timer->state & HRTIMER_STATE_ENQUEUED)) in hrtimer_forward()
1063 hrtimer_add_expires_ns(timer, incr * orun); in hrtimer_forward()
1064 if (hrtimer_get_expires(timer) > now) in hrtimer_forward()
1072 hrtimer_add_expires(timer, interval); in hrtimer_forward()
1079 * enqueue_hrtimer - internal function to (re)start a timer
1081 * The timer is inserted in expiry order. Insertion into the
1084 * Returns true when the new timer is the leftmost timer in the tree.
1086 static bool enqueue_hrtimer(struct hrtimer *timer, struct hrtimer_clock_base *base, in enqueue_hrtimer() argument
1089 debug_activate(timer, mode); in enqueue_hrtimer()
1095 WRITE_ONCE(timer->state, HRTIMER_STATE_ENQUEUED); in enqueue_hrtimer()
1097 return timerqueue_add(&base->active, &timer->node); in enqueue_hrtimer()
1101 * __remove_hrtimer - internal function to remove a timer
1105 * High resolution timer mode reprograms the clock event device when the
1106 * timer is the one which expires next. The caller can disable this by setting
1108 * anyway (e.g. timer interrupt)
1110 static void __remove_hrtimer(struct hrtimer *timer, in __remove_hrtimer() argument
1115 u8 state = timer->state; in __remove_hrtimer()
1118 WRITE_ONCE(timer->state, newstate); in __remove_hrtimer()
1122 if (!timerqueue_del(&base->active, &timer->node)) in __remove_hrtimer()
1128 * timer on a remote cpu. No harm as we never dereference in __remove_hrtimer()
1131 * remote cpu later on if the same timer gets enqueued again. in __remove_hrtimer()
1133 if (reprogram && timer == cpu_base->next_timer) in __remove_hrtimer()
1141 remove_hrtimer(struct hrtimer *timer, struct hrtimer_clock_base *base, in remove_hrtimer() argument
1144 u8 state = timer->state; in remove_hrtimer()
1150 * Remove the timer and force reprogramming when high in remove_hrtimer()
1151 * resolution mode is active and the timer is on the current in remove_hrtimer()
1152 * CPU. If we remove a timer on another CPU, reprogramming is in remove_hrtimer()
1157 debug_deactivate(timer); in remove_hrtimer()
1161 * If the timer is not restarted then reprogramming is in remove_hrtimer()
1162 * required if the timer is local. If it is local and about in remove_hrtimer()
1171 __remove_hrtimer(timer, base, state, reprogram); in remove_hrtimer()
1177 static inline ktime_t hrtimer_update_lowres(struct hrtimer *timer, ktime_t tim, in hrtimer_update_lowres() argument
1186 timer->is_rel = mode & HRTIMER_MODE_REL; in hrtimer_update_lowres()
1187 if (timer->is_rel) in hrtimer_update_lowres()
1218 static int __hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, in __hrtimer_start_range_ns() argument
1227 * If the timer is on the local cpu base and is the first expiring in __hrtimer_start_range_ns()
1228 * timer then this might end up reprogramming the hardware twice in __hrtimer_start_range_ns()
1230 * reprogram on removal, keep the timer local to the current CPU in __hrtimer_start_range_ns()
1232 * it is the new first expiring timer again or not. in __hrtimer_start_range_ns()
1235 force_local &= base->cpu_base->next_timer == timer; in __hrtimer_start_range_ns()
1244 * Remove an active timer from the queue. In case it is not queued in __hrtimer_start_range_ns()
1248 * If it's on the current CPU and the first expiring timer, then in __hrtimer_start_range_ns()
1249 * skip reprogramming, keep the timer local and enforce in __hrtimer_start_range_ns()
1250 * reprogramming later if it was the first expiring timer. This in __hrtimer_start_range_ns()
1254 remove_hrtimer(timer, base, true, force_local); in __hrtimer_start_range_ns()
1259 tim = hrtimer_update_lowres(timer, tim, mode); in __hrtimer_start_range_ns()
1261 hrtimer_set_expires_range_ns(timer, tim, delta_ns); in __hrtimer_start_range_ns()
1263 /* Switch the timer base, if necessary: */ in __hrtimer_start_range_ns()
1265 new_base = switch_hrtimer_base(timer, base, in __hrtimer_start_range_ns()
1271 first = enqueue_hrtimer(timer, new_base, mode); in __hrtimer_start_range_ns()
1274 * If the current CPU base is online, then the timer is in __hrtimer_start_range_ns()
1276 * expiring timer there. in __hrtimer_start_range_ns()
1282 * Timer was enqueued remote because the current base is in __hrtimer_start_range_ns()
1283 * already offline. If the timer is the first to expire, in __hrtimer_start_range_ns()
1295 * Timer was forced to stay on the current CPU to avoid in __hrtimer_start_range_ns()
1297 * hardware by evaluating the new first expiring timer. in __hrtimer_start_range_ns()
1305 * @timer: the timer to be added
1307 * @delta_ns: "slack" range for the timer
1308 * @mode: timer mode: absolute (HRTIMER_MODE_ABS) or
1312 void hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, in hrtimer_start_range_ns() argument
1324 WARN_ON_ONCE(!(mode & HRTIMER_MODE_SOFT) ^ !timer->is_soft); in hrtimer_start_range_ns()
1326 WARN_ON_ONCE(!(mode & HRTIMER_MODE_HARD) ^ !timer->is_hard); in hrtimer_start_range_ns()
1328 base = lock_hrtimer_base(timer, &flags); in hrtimer_start_range_ns()
1330 if (__hrtimer_start_range_ns(timer, tim, delta_ns, mode, base)) in hrtimer_start_range_ns()
1331 hrtimer_reprogram(timer, true); in hrtimer_start_range_ns()
1333 unlock_hrtimer_base(timer, &flags); in hrtimer_start_range_ns()
1338 * hrtimer_try_to_cancel - try to deactivate a timer
1339 * @timer: hrtimer to stop
1343 * * 0 when the timer was not active
1344 * * 1 when the timer was active
1345 * * -1 when the timer is currently executing the callback function and
1348 int hrtimer_try_to_cancel(struct hrtimer *timer) in hrtimer_try_to_cancel() argument
1355 * Check lockless first. If the timer is not active (neither in hrtimer_try_to_cancel()
1360 if (!hrtimer_active(timer)) in hrtimer_try_to_cancel()
1363 base = lock_hrtimer_base(timer, &flags); in hrtimer_try_to_cancel()
1365 if (!hrtimer_callback_running(timer)) in hrtimer_try_to_cancel()
1366 ret = remove_hrtimer(timer, base, false, false); in hrtimer_try_to_cancel()
1368 unlock_hrtimer_base(timer, &flags); in hrtimer_try_to_cancel()
1397 * the timer callback to finish. Drop expiry_lock and reacquire it. That
1425 * deletion of a timer failed because the timer callback function was
1429 * in the middle of a timer callback, then calling hrtimer_cancel() can
1432 * - If the caller is on a remote CPU then it has to spin wait for the timer
1435 * - If the caller originates from the task which preempted the timer
1436 * handler on the same CPU, then spin waiting for the timer handler to
1439 void hrtimer_cancel_wait_running(const struct hrtimer *timer) in hrtimer_cancel_wait_running() argument
1442 struct hrtimer_clock_base *base = READ_ONCE(timer->base); in hrtimer_cancel_wait_running()
1445 * Just relax if the timer expires in hard interrupt context or if in hrtimer_cancel_wait_running()
1448 if (!timer->is_soft || is_migration_base(base)) { in hrtimer_cancel_wait_running()
1455 * held by the softirq across the timer callback. Drop the lock in hrtimer_cancel_wait_running()
1456 * immediately so the softirq can expire the next timer. In theory in hrtimer_cancel_wait_running()
1457 * the timer could already be running again, but that's more than in hrtimer_cancel_wait_running()
1477 * hrtimer_cancel - cancel a timer and wait for the handler to finish.
1478 * @timer: the timer to be cancelled
1481 * 0 when the timer was not active
1482 * 1 when the timer was active
1484 int hrtimer_cancel(struct hrtimer *timer) in hrtimer_cancel() argument
1489 ret = hrtimer_try_to_cancel(timer); in hrtimer_cancel()
1492 hrtimer_cancel_wait_running(timer); in hrtimer_cancel()
1499 * __hrtimer_get_remaining - get remaining time for the timer
1500 * @timer: the timer to read
1503 ktime_t __hrtimer_get_remaining(const struct hrtimer *timer, bool adjust) in __hrtimer_get_remaining() argument
1508 lock_hrtimer_base(timer, &flags); in __hrtimer_get_remaining()
1510 rem = hrtimer_expires_remaining_adjusted(timer); in __hrtimer_get_remaining()
1512 rem = hrtimer_expires_remaining(timer); in __hrtimer_get_remaining()
1513 unlock_hrtimer_base(timer, &flags); in __hrtimer_get_remaining()
1523 * Returns the next expiry time or KTIME_MAX if no timer is pending.
1542 * hrtimer_next_event_without - time until next expiry event w/o one timer
1543 * @exclude: timer to exclude
1609 ktime_t hrtimer_cb_get_time(const struct hrtimer *timer) in hrtimer_cb_get_time() argument
1611 return __hrtimer_cb_get_time(timer->base->clockid); in hrtimer_cb_get_time()
1615 static void __hrtimer_setup(struct hrtimer *timer, in __hrtimer_setup() argument
1632 memset(timer, 0, sizeof(struct hrtimer)); in __hrtimer_setup()
1646 timer->is_soft = softtimer; in __hrtimer_setup()
1647 timer->is_hard = !!(mode & HRTIMER_MODE_HARD); in __hrtimer_setup()
1648 timer->base = &cpu_base->clock_base[base]; in __hrtimer_setup()
1649 timerqueue_init(&timer->node); in __hrtimer_setup()
1652 ACCESS_PRIVATE(timer, function) = hrtimer_dummy_timeout; in __hrtimer_setup()
1654 ACCESS_PRIVATE(timer, function) = function; in __hrtimer_setup()
1658 * hrtimer_setup - initialize a timer to the given clock
1659 * @timer: the timer to be initialized
1670 void hrtimer_setup(struct hrtimer *timer, enum hrtimer_restart (*function)(struct hrtimer *), in hrtimer_setup() argument
1673 debug_setup(timer, clock_id, mode); in hrtimer_setup()
1674 __hrtimer_setup(timer, function, clock_id, mode); in hrtimer_setup()
1679 * hrtimer_setup_on_stack - initialize a timer on stack memory
1680 * @timer: The timer to be initialized
1683 * @mode: The timer mode
1688 void hrtimer_setup_on_stack(struct hrtimer *timer, in hrtimer_setup_on_stack() argument
1692 debug_setup_on_stack(timer, clock_id, mode); in hrtimer_setup_on_stack()
1693 __hrtimer_setup(timer, function, clock_id, mode); in hrtimer_setup_on_stack()
1698 * A timer is active, when it is enqueued into the rbtree or the
1704 bool hrtimer_active(const struct hrtimer *timer) in hrtimer_active() argument
1710 base = READ_ONCE(timer->base); in hrtimer_active()
1713 if (timer->state != HRTIMER_STATE_INACTIVE || in hrtimer_active()
1714 base->running == timer) in hrtimer_active()
1718 base != READ_ONCE(timer->base)); in hrtimer_active()
1728 * - queued: the timer is queued
1729 * - callback: the timer is being ran
1730 * - post: the timer is inactive or (re)queued
1732 * On the read side we ensure we observe timer->state and cpu_base->running
1734 * This includes timer->base changing because sequence numbers alone are
1744 struct hrtimer *timer, ktime_t *now, in __run_hrtimer() argument
1753 debug_hrtimer_deactivate(timer); in __run_hrtimer()
1754 base->running = timer; in __run_hrtimer()
1761 * timer->state == INACTIVE. in __run_hrtimer()
1765 __remove_hrtimer(timer, base, HRTIMER_STATE_INACTIVE, 0); in __run_hrtimer()
1766 fn = ACCESS_PRIVATE(timer, function); in __run_hrtimer()
1770 * timer is restarted with a period then it becomes an absolute in __run_hrtimer()
1771 * timer. If its not restarted it does not matter. in __run_hrtimer()
1774 timer->is_rel = false; in __run_hrtimer()
1777 * The timer is marked as running in the CPU base, so it is in __run_hrtimer()
1782 trace_hrtimer_expire_entry(timer, now); in __run_hrtimer()
1783 expires_in_hardirq = lockdep_hrtimer_enter(timer); in __run_hrtimer()
1785 restart = fn(timer); in __run_hrtimer()
1788 trace_hrtimer_expire_exit(timer); in __run_hrtimer()
1797 * hrtimer_start_range_ns() can have popped in and enqueued the timer in __run_hrtimer()
1801 !(timer->state & HRTIMER_STATE_ENQUEUED)) in __run_hrtimer()
1802 enqueue_hrtimer(timer, base, HRTIMER_MODE_ABS); in __run_hrtimer()
1808 * hrtimer_active() cannot observe base->running.timer == NULL && in __run_hrtimer()
1809 * timer->state == INACTIVE. in __run_hrtimer()
1813 WARN_ON_ONCE(base->running != timer); in __run_hrtimer()
1830 struct hrtimer *timer; in __hrtimer_run_queues() local
1832 timer = container_of(node, struct hrtimer, node); in __hrtimer_run_queues()
1843 * are right-of a not yet expired timer, because that in __hrtimer_run_queues()
1844 * timer will have to trigger a wakeup anyway. in __hrtimer_run_queues()
1846 if (basenow < hrtimer_get_softexpires(timer)) in __hrtimer_run_queues()
1849 __run_hrtimer(cpu_base, base, timer, &basenow, flags); in __hrtimer_run_queues()
1878 * High resolution timer interrupt
1898 * held to prevent that a timer is enqueued in our queue via in hrtimer_interrupt()
1930 * The next timer was already expired due to: in hrtimer_interrupt()
2013 static enum hrtimer_restart hrtimer_wakeup(struct hrtimer *timer) in hrtimer_wakeup() argument
2016 container_of(timer, struct hrtimer_sleeper, timer); in hrtimer_wakeup()
2027 * hrtimer_sleeper_start_expires - Start a hrtimer sleeper timer
2029 * @mode: timer mode abs/rel
2044 if (IS_ENABLED(CONFIG_PREEMPT_RT) && sl->timer.is_hard) in hrtimer_sleeper_start_expires()
2047 hrtimer_start_expires(&sl->timer, mode); in hrtimer_sleeper_start_expires()
2078 __hrtimer_setup(&sl->timer, hrtimer_wakeup, clock_id, mode); in __hrtimer_setup_sleeper()
2086 * @mode: timer mode abs/rel
2091 debug_setup_on_stack(&sl->timer, clock_id, mode); in hrtimer_setup_sleeper_on_stack()
2126 hrtimer_cancel(&t->timer); in do_nanosleep()
2138 ktime_t rem = hrtimer_expires_remaining(&t->timer); in do_nanosleep()
2156 hrtimer_set_expires(&t.timer, restart->nanosleep.expires); in hrtimer_nanosleep_restart()
2158 destroy_hrtimer_on_stack(&t.timer); in hrtimer_nanosleep_restart()
2170 hrtimer_set_expires_range_ns(&t.timer, rqtp, current->timer_slack_ns); in hrtimer_nanosleep()
2182 restart->nanosleep.clockid = t.timer.base->clockid; in hrtimer_nanosleep()
2183 restart->nanosleep.expires = hrtimer_get_expires(&t.timer); in hrtimer_nanosleep()
2186 destroy_hrtimer_on_stack(&t.timer); in hrtimer_nanosleep()
2275 struct hrtimer *timer; in migrate_hrtimer_list() local
2279 timer = container_of(node, struct hrtimer, node); in migrate_hrtimer_list()
2280 BUG_ON(hrtimer_callback_running(timer)); in migrate_hrtimer_list()
2281 debug_deactivate(timer); in migrate_hrtimer_list()
2285 * timer could be seen as !active and just vanish away in migrate_hrtimer_list()
2288 __remove_hrtimer(timer, old_base, HRTIMER_STATE_ENQUEUED, 0); in migrate_hrtimer_list()
2289 timer->base = new_base; in migrate_hrtimer_list()
2292 * reprogram the event device in case the timer in migrate_hrtimer_list()
2298 enqueue_hrtimer(timer, new_base, HRTIMER_MODE_ABS); in migrate_hrtimer_list()