• Home
  • Raw
  • Download

Lines Matching refs:base

143 static inline bool is_migration_base(struct hrtimer_clock_base *base)  in is_migration_base()  argument
145 return base == &migration_base; in is_migration_base()
164 struct hrtimer_clock_base *base; in lock_hrtimer_base() local
167 base = READ_ONCE(timer->base); in lock_hrtimer_base()
168 if (likely(base != &migration_base)) { in lock_hrtimer_base()
169 raw_spin_lock_irqsave(&base->cpu_base->lock, *flags); in lock_hrtimer_base()
170 if (likely(base == timer->base)) in lock_hrtimer_base()
171 return base; in lock_hrtimer_base()
173 raw_spin_unlock_irqrestore(&base->cpu_base->lock, *flags); in lock_hrtimer_base()
198 struct hrtimer_cpu_base *get_target_base(struct hrtimer_cpu_base *base, in get_target_base() argument
205 return base; in get_target_base()
221 switch_hrtimer_base(struct hrtimer *timer, struct hrtimer_clock_base *base, in switch_hrtimer_base() argument
226 int basenum = base->index; in switch_hrtimer_base()
233 if (base != new_base) { in switch_hrtimer_base()
244 return base; in switch_hrtimer_base()
247 WRITE_ONCE(timer->base, &migration_base); in switch_hrtimer_base()
248 raw_spin_unlock(&base->cpu_base->lock); in switch_hrtimer_base()
254 raw_spin_lock(&base->cpu_base->lock); in switch_hrtimer_base()
256 WRITE_ONCE(timer->base, base); in switch_hrtimer_base()
259 WRITE_ONCE(timer->base, new_base); in switch_hrtimer_base()
272 static inline bool is_migration_base(struct hrtimer_clock_base *base) in is_migration_base() argument
280 struct hrtimer_clock_base *base = timer->base; in lock_hrtimer_base() local
282 raw_spin_lock_irqsave(&base->cpu_base->lock, *flags); in lock_hrtimer_base()
284 return base; in lock_hrtimer_base()
500 #define for_each_active_base(base, cpu_base, active) \ argument
501 while ((base = __next_base((cpu_base), &(active))))
508 struct hrtimer_clock_base *base; in __hrtimer_next_event_base() local
511 for_each_active_base(base, cpu_base, active) { in __hrtimer_next_event_base()
515 next = timerqueue_getnext(&base->active); in __hrtimer_next_event_base()
525 expires = ktime_sub(hrtimer_get_expires(timer), base->offset); in __hrtimer_next_event_base()
592 static inline ktime_t hrtimer_update_base(struct hrtimer_cpu_base *base) in hrtimer_update_base() argument
594 ktime_t *offs_real = &base->clock_base[HRTIMER_BASE_REALTIME].offset; in hrtimer_update_base()
595 ktime_t *offs_boot = &base->clock_base[HRTIMER_BASE_BOOTTIME].offset; in hrtimer_update_base()
596 ktime_t *offs_tai = &base->clock_base[HRTIMER_BASE_TAI].offset; in hrtimer_update_base()
598 ktime_t now = ktime_get_update_offsets_now(&base->clock_was_set_seq, in hrtimer_update_base()
601 base->clock_base[HRTIMER_BASE_REALTIME_SOFT].offset = *offs_real; in hrtimer_update_base()
602 base->clock_base[HRTIMER_BASE_BOOTTIME_SOFT].offset = *offs_boot; in hrtimer_update_base()
603 base->clock_base[HRTIMER_BASE_TAI_SOFT].offset = *offs_tai; in hrtimer_update_base()
713 struct hrtimer_cpu_base *base = this_cpu_ptr(&hrtimer_bases); in retrigger_next_event() local
715 if (!__hrtimer_hres_active(base)) in retrigger_next_event()
718 raw_spin_lock(&base->lock); in retrigger_next_event()
719 hrtimer_update_base(base); in retrigger_next_event()
720 hrtimer_force_reprogram(base, 0); in retrigger_next_event()
721 raw_spin_unlock(&base->lock); in retrigger_next_event()
729 struct hrtimer_cpu_base *base = this_cpu_ptr(&hrtimer_bases); in hrtimer_switch_to_hres() local
733 base->cpu); in hrtimer_switch_to_hres()
736 base->hres_active = 1; in hrtimer_switch_to_hres()
778 struct hrtimer_clock_base *base = timer->base; in hrtimer_reprogram() local
779 ktime_t expires = ktime_sub(hrtimer_get_expires(timer), base->offset); in hrtimer_reprogram()
798 struct hrtimer_cpu_base *timer_cpu_base = base->cpu_base; in hrtimer_reprogram()
818 if (base->cpu_base != cpu_base) in hrtimer_reprogram()
898 raw_spin_unlock_irqrestore(&timer->base->cpu_base->lock, *flags); in unlock_hrtimer_base()
962 struct hrtimer_clock_base *base, in enqueue_hrtimer() argument
967 base->cpu_base->active_bases |= 1 << base->index; in enqueue_hrtimer()
972 return timerqueue_add(&base->active, &timer->node); in enqueue_hrtimer()
986 struct hrtimer_clock_base *base, in __remove_hrtimer() argument
989 struct hrtimer_cpu_base *cpu_base = base->cpu_base; in __remove_hrtimer()
997 if (!timerqueue_del(&base->active, &timer->node)) in __remove_hrtimer()
998 cpu_base->active_bases &= ~(1 << base->index); in __remove_hrtimer()
1016 remove_hrtimer(struct hrtimer *timer, struct hrtimer_clock_base *base, bool restart) in remove_hrtimer() argument
1032 reprogram = base->cpu_base == this_cpu_ptr(&hrtimer_bases); in remove_hrtimer()
1037 __remove_hrtimer(timer, base, state, reprogram); in remove_hrtimer()
1086 struct hrtimer_clock_base *base) in __hrtimer_start_range_ns() argument
1091 remove_hrtimer(timer, base, true); in __hrtimer_start_range_ns()
1094 tim = ktime_add_safe(tim, base->get_time()); in __hrtimer_start_range_ns()
1101 new_base = switch_hrtimer_base(timer, base, mode & HRTIMER_MODE_PINNED); in __hrtimer_start_range_ns()
1118 struct hrtimer_clock_base *base; in hrtimer_start_range_ns() local
1131 base = lock_hrtimer_base(timer, &flags); in hrtimer_start_range_ns()
1133 if (__hrtimer_start_range_ns(timer, tim, delta_ns, mode, base)) in hrtimer_start_range_ns()
1153 struct hrtimer_clock_base *base; in hrtimer_try_to_cancel() local
1166 base = lock_hrtimer_base(timer, &flags); in hrtimer_try_to_cancel()
1169 ret = remove_hrtimer(timer, base, false); in hrtimer_try_to_cancel()
1179 static void hrtimer_cpu_base_init_expiry_lock(struct hrtimer_cpu_base *base) in hrtimer_cpu_base_init_expiry_lock() argument
1181 spin_lock_init(&base->softirq_expiry_lock); in hrtimer_cpu_base_init_expiry_lock()
1184 static void hrtimer_cpu_base_lock_expiry(struct hrtimer_cpu_base *base) in hrtimer_cpu_base_lock_expiry() argument
1186 spin_lock(&base->softirq_expiry_lock); in hrtimer_cpu_base_lock_expiry()
1189 static void hrtimer_cpu_base_unlock_expiry(struct hrtimer_cpu_base *base) in hrtimer_cpu_base_unlock_expiry() argument
1191 spin_unlock(&base->softirq_expiry_lock); in hrtimer_cpu_base_unlock_expiry()
1231 struct hrtimer_clock_base *base = READ_ONCE(timer->base); in hrtimer_cancel_wait_running() local
1237 if (!timer->is_soft || is_migration_base(base)) { in hrtimer_cancel_wait_running()
1249 atomic_inc(&base->cpu_base->timer_waiters); in hrtimer_cancel_wait_running()
1250 spin_lock_bh(&base->cpu_base->softirq_expiry_lock); in hrtimer_cancel_wait_running()
1251 atomic_dec(&base->cpu_base->timer_waiters); in hrtimer_cancel_wait_running()
1252 spin_unlock_bh(&base->cpu_base->softirq_expiry_lock); in hrtimer_cancel_wait_running()
1256 hrtimer_cpu_base_init_expiry_lock(struct hrtimer_cpu_base *base) { } in hrtimer_cpu_base_init_expiry_lock() argument
1258 hrtimer_cpu_base_lock_expiry(struct hrtimer_cpu_base *base) { } in hrtimer_cpu_base_lock_expiry() argument
1260 hrtimer_cpu_base_unlock_expiry(struct hrtimer_cpu_base *base) { } in hrtimer_cpu_base_unlock_expiry() argument
1261 static inline void hrtimer_sync_wait_running(struct hrtimer_cpu_base *base, in hrtimer_sync_wait_running() argument
1367 int base = hrtimer_clock_to_base_table[clock_id]; in hrtimer_clockid_to_base() local
1369 if (likely(base != HRTIMER_MAX_CLOCK_BASES)) in hrtimer_clockid_to_base()
1370 return base; in hrtimer_clockid_to_base()
1381 int base; in __hrtimer_init() local
1404 base = softtimer ? HRTIMER_MAX_CLOCK_BASES / 2 : 0; in __hrtimer_init()
1405 base += hrtimer_clockid_to_base(clock_id); in __hrtimer_init()
1408 timer->base = &cpu_base->clock_base[base]; in __hrtimer_init()
1441 struct hrtimer_clock_base *base; in hrtimer_active() local
1445 base = READ_ONCE(timer->base); in hrtimer_active()
1446 seq = raw_read_seqcount_begin(&base->seq); in hrtimer_active()
1449 base->running == timer) in hrtimer_active()
1452 } while (read_seqcount_retry(&base->seq, seq) || in hrtimer_active()
1453 base != READ_ONCE(timer->base)); in hrtimer_active()
1478 struct hrtimer_clock_base *base, in __run_hrtimer() argument
1488 base->running = timer; in __run_hrtimer()
1497 raw_write_seqcount_barrier(&base->seq); in __run_hrtimer()
1499 __remove_hrtimer(timer, base, HRTIMER_STATE_INACTIVE, 0); in __run_hrtimer()
1532 enqueue_hrtimer(timer, base, HRTIMER_MODE_ABS); in __run_hrtimer()
1541 raw_write_seqcount_barrier(&base->seq); in __run_hrtimer()
1543 WARN_ON_ONCE(base->running != timer); in __run_hrtimer()
1544 base->running = NULL; in __run_hrtimer()
1550 struct hrtimer_clock_base *base; in __hrtimer_run_queues() local
1553 for_each_active_base(base, cpu_base, active) { in __hrtimer_run_queues()
1557 basenow = ktime_add(now, base->offset); in __hrtimer_run_queues()
1559 while ((node = timerqueue_getnext(&base->active))) { in __hrtimer_run_queues()
1579 __run_hrtimer(cpu_base, base, timer, &basenow, flags); in __hrtimer_run_queues()
1939 restart->nanosleep.clockid = t.timer.base->clockid; in hrtimer_nanosleep()
2029 timer->base = new_base; in migrate_hrtimer_list()