Lines Matching refs:cpu_base
121 .clock_base = { { .cpu_base = &migration_cpu_base, }, },
147 raw_spin_lock_irqsave(&base->cpu_base->lock, *flags); in lock_hrtimer_base()
151 raw_spin_unlock_irqrestore(&base->cpu_base->lock, *flags); in lock_hrtimer_base()
170 if (!new_base->cpu_base->hres_active) in hrtimer_check_target()
174 return expires.tv64 <= new_base->cpu_base->expires_next.tv64; in hrtimer_check_target()
238 raw_spin_unlock(&base->cpu_base->lock); in switch_hrtimer_base()
239 raw_spin_lock(&new_base->cpu_base->lock); in switch_hrtimer_base()
243 raw_spin_unlock(&new_base->cpu_base->lock); in switch_hrtimer_base()
244 raw_spin_lock(&base->cpu_base->lock); in switch_hrtimer_base()
267 raw_spin_lock_irqsave(&base->cpu_base->lock, *flags); in lock_hrtimer_base()
461 static inline void hrtimer_update_next_timer(struct hrtimer_cpu_base *cpu_base, in hrtimer_update_next_timer() argument
465 cpu_base->next_timer = timer; in hrtimer_update_next_timer()
469 static ktime_t __hrtimer_get_next_event(struct hrtimer_cpu_base *cpu_base) in __hrtimer_get_next_event() argument
471 struct hrtimer_clock_base *base = cpu_base->clock_base; in __hrtimer_get_next_event()
473 unsigned int active = cpu_base->active_bases; in __hrtimer_get_next_event()
475 hrtimer_update_next_timer(cpu_base, NULL); in __hrtimer_get_next_event()
488 hrtimer_update_next_timer(cpu_base, timer); in __hrtimer_get_next_event()
549 static inline int __hrtimer_hres_active(struct hrtimer_cpu_base *cpu_base) in __hrtimer_hres_active() argument
551 return cpu_base->hres_active; in __hrtimer_hres_active()
565 hrtimer_force_reprogram(struct hrtimer_cpu_base *cpu_base, int skip_equal) in hrtimer_force_reprogram() argument
569 if (!cpu_base->hres_active) in hrtimer_force_reprogram()
572 expires_next = __hrtimer_get_next_event(cpu_base); in hrtimer_force_reprogram()
574 if (skip_equal && expires_next.tv64 == cpu_base->expires_next.tv64) in hrtimer_force_reprogram()
577 cpu_base->expires_next.tv64 = expires_next.tv64; in hrtimer_force_reprogram()
593 if (cpu_base->hang_detected) in hrtimer_force_reprogram()
596 tick_program_event(cpu_base->expires_next, 1); in hrtimer_force_reprogram()
609 struct hrtimer_cpu_base *cpu_base = this_cpu_ptr(&hrtimer_bases); in hrtimer_reprogram() local
618 if (base->cpu_base != cpu_base) in hrtimer_reprogram()
628 if (cpu_base->in_hrtirq) in hrtimer_reprogram()
638 if (expires.tv64 >= cpu_base->expires_next.tv64) in hrtimer_reprogram()
642 cpu_base->next_timer = timer; in hrtimer_reprogram()
650 if (cpu_base->hang_detected) in hrtimer_reprogram()
657 cpu_base->expires_next = expires; in hrtimer_reprogram()
813 raw_spin_unlock_irqrestore(&timer->base->cpu_base->lock, *flags); in unlock_hrtimer_base()
881 base->cpu_base->active_bases |= 1 << base->index; in enqueue_hrtimer()
902 struct hrtimer_cpu_base *cpu_base = base->cpu_base; in __remove_hrtimer() local
910 cpu_base->active_bases &= ~(1 << base->index); in __remove_hrtimer()
921 if (reprogram && timer == cpu_base->next_timer) in __remove_hrtimer()
922 hrtimer_force_reprogram(cpu_base, 1); in __remove_hrtimer()
946 reprogram = base->cpu_base == this_cpu_ptr(&hrtimer_bases); in remove_hrtimer()
1014 if (new_base->cpu_base->nohz_active) in hrtimer_start_range_ns()
1015 wake_up_nohz_cpu(new_base->cpu_base->cpu); in hrtimer_start_range_ns()
1110 struct hrtimer_cpu_base *cpu_base = this_cpu_ptr(&hrtimer_bases); in hrtimer_get_next_event() local
1114 raw_spin_lock_irqsave(&cpu_base->lock, flags); in hrtimer_get_next_event()
1116 if (!__hrtimer_hres_active(cpu_base)) in hrtimer_get_next_event()
1117 expires = __hrtimer_get_next_event(cpu_base).tv64; in hrtimer_get_next_event()
1119 raw_spin_unlock_irqrestore(&cpu_base->lock, flags); in hrtimer_get_next_event()
1128 struct hrtimer_cpu_base *cpu_base; in __hrtimer_init() local
1133 cpu_base = raw_cpu_ptr(&hrtimer_bases); in __hrtimer_init()
1139 timer->base = &cpu_base->clock_base[base]; in __hrtimer_init()
1172 struct hrtimer_cpu_base *cpu_base; in hrtimer_active() local
1176 cpu_base = READ_ONCE(timer->base->cpu_base); in hrtimer_active()
1177 seq = raw_read_seqcount_begin(&cpu_base->seq); in hrtimer_active()
1180 cpu_base->running == timer) in hrtimer_active()
1183 } while (read_seqcount_retry(&cpu_base->seq, seq) || in hrtimer_active()
1184 cpu_base != READ_ONCE(timer->base->cpu_base)); in hrtimer_active()
1208 static void __run_hrtimer(struct hrtimer_cpu_base *cpu_base, in __run_hrtimer() argument
1215 lockdep_assert_held(&cpu_base->lock); in __run_hrtimer()
1218 cpu_base->running = timer; in __run_hrtimer()
1227 raw_write_seqcount_barrier(&cpu_base->seq); in __run_hrtimer()
1246 raw_spin_unlock(&cpu_base->lock); in __run_hrtimer()
1250 raw_spin_lock(&cpu_base->lock); in __run_hrtimer()
1272 raw_write_seqcount_barrier(&cpu_base->seq); in __run_hrtimer()
1274 WARN_ON_ONCE(cpu_base->running != timer); in __run_hrtimer()
1275 cpu_base->running = NULL; in __run_hrtimer()
1278 static void __hrtimer_run_queues(struct hrtimer_cpu_base *cpu_base, ktime_t now) in __hrtimer_run_queues() argument
1280 struct hrtimer_clock_base *base = cpu_base->clock_base; in __hrtimer_run_queues()
1281 unsigned int active = cpu_base->active_bases; in __hrtimer_run_queues()
1312 __run_hrtimer(cpu_base, base, timer, &basenow); in __hrtimer_run_queues()
1325 struct hrtimer_cpu_base *cpu_base = this_cpu_ptr(&hrtimer_bases); in hrtimer_interrupt() local
1329 BUG_ON(!cpu_base->hres_active); in hrtimer_interrupt()
1330 cpu_base->nr_events++; in hrtimer_interrupt()
1333 raw_spin_lock(&cpu_base->lock); in hrtimer_interrupt()
1334 entry_time = now = hrtimer_update_base(cpu_base); in hrtimer_interrupt()
1336 cpu_base->in_hrtirq = 1; in hrtimer_interrupt()
1344 cpu_base->expires_next.tv64 = KTIME_MAX; in hrtimer_interrupt()
1346 __hrtimer_run_queues(cpu_base, now); in hrtimer_interrupt()
1349 expires_next = __hrtimer_get_next_event(cpu_base); in hrtimer_interrupt()
1354 cpu_base->expires_next = expires_next; in hrtimer_interrupt()
1355 cpu_base->in_hrtirq = 0; in hrtimer_interrupt()
1356 raw_spin_unlock(&cpu_base->lock); in hrtimer_interrupt()
1360 cpu_base->hang_detected = 0; in hrtimer_interrupt()
1377 raw_spin_lock(&cpu_base->lock); in hrtimer_interrupt()
1378 now = hrtimer_update_base(cpu_base); in hrtimer_interrupt()
1379 cpu_base->nr_retries++; in hrtimer_interrupt()
1388 cpu_base->nr_hangs++; in hrtimer_interrupt()
1389 cpu_base->hang_detected = 1; in hrtimer_interrupt()
1390 raw_spin_unlock(&cpu_base->lock); in hrtimer_interrupt()
1392 if ((unsigned int)delta.tv64 > cpu_base->max_hang_time) in hrtimer_interrupt()
1393 cpu_base->max_hang_time = (unsigned int) delta.tv64; in hrtimer_interrupt()
1434 struct hrtimer_cpu_base *cpu_base = this_cpu_ptr(&hrtimer_bases); in hrtimer_run_queues() local
1437 if (__hrtimer_hres_active(cpu_base)) in hrtimer_run_queues()
1452 raw_spin_lock(&cpu_base->lock); in hrtimer_run_queues()
1453 now = hrtimer_update_base(cpu_base); in hrtimer_run_queues()
1454 __hrtimer_run_queues(cpu_base, now); in hrtimer_run_queues()
1455 raw_spin_unlock(&cpu_base->lock); in hrtimer_run_queues()
1605 struct hrtimer_cpu_base *cpu_base = &per_cpu(hrtimer_bases, cpu); in init_hrtimers_cpu() local
1609 cpu_base->clock_base[i].cpu_base = cpu_base; in init_hrtimers_cpu()
1610 timerqueue_init_head(&cpu_base->clock_base[i].active); in init_hrtimers_cpu()
1613 cpu_base->cpu = cpu; in init_hrtimers_cpu()
1614 hrtimer_init_hres(cpu_base); in init_hrtimers_cpu()