Home
last modified time | relevance | path

Searched refs:timer (Results 1 – 25 of 33) sorted by relevance

12

/kernel/time/
Dtimer.c506 static inline unsigned int timer_get_idx(struct timer_list *timer) in timer_get_idx() argument
508 return (timer->flags & TIMER_ARRAYMASK) >> TIMER_ARRAYSHIFT; in timer_get_idx()
511 static inline void timer_set_idx(struct timer_list *timer, unsigned int idx) in timer_set_idx() argument
513 timer->flags = (timer->flags & ~TIMER_ARRAYMASK) | in timer_set_idx()
578 trigger_dyntick_cpu(struct timer_base *base, struct timer_list *timer) in trigger_dyntick_cpu() argument
587 if (timer->flags & TIMER_DEFERRABLE) { in trigger_dyntick_cpu()
607 static void enqueue_timer(struct timer_base *base, struct timer_list *timer, in enqueue_timer() argument
611 hlist_add_head(&timer->entry, base->vectors + idx); in enqueue_timer()
613 timer_set_idx(timer, idx); in enqueue_timer()
615 trace_timer_start(timer, timer->expires, timer->flags); in enqueue_timer()
[all …]
Dhrtimer.c165 struct hrtimer_clock_base *lock_hrtimer_base(const struct hrtimer *timer, in lock_hrtimer_base() argument
171 base = READ_ONCE(timer->base); in lock_hrtimer_base()
174 if (likely(base == timer->base)) in lock_hrtimer_base()
193 hrtimer_check_target(struct hrtimer *timer, struct hrtimer_clock_base *new_base) in hrtimer_check_target() argument
197 expires = ktime_sub(hrtimer_get_expires(timer), new_base->offset); in hrtimer_check_target()
225 switch_hrtimer_base(struct hrtimer *timer, struct hrtimer_clock_base *base, in switch_hrtimer_base() argument
247 if (unlikely(hrtimer_callback_running(timer))) in switch_hrtimer_base()
251 WRITE_ONCE(timer->base, &migration_base); in switch_hrtimer_base()
256 hrtimer_check_target(timer, new_base)) { in switch_hrtimer_base()
260 WRITE_ONCE(timer->base, base); in switch_hrtimer_base()
[all …]
Dposix-cpu-timers.c22 static void posix_cpu_timer_rearm(struct k_itimer *timer);
113 static inline struct task_struct *cpu_timer_task_rcu(struct k_itimer *timer) in cpu_timer_task_rcu() argument
115 return pid_task(timer->it.cpu.pid, clock_pid_type(timer->it_clock)); in cpu_timer_task_rcu()
122 static u64 bump_cpu_timer(struct k_itimer *timer, u64 now) in bump_cpu_timer() argument
124 u64 delta, incr, expires = timer->it.cpu.node.expires; in bump_cpu_timer()
127 if (!timer->it_interval) in bump_cpu_timer()
133 incr = timer->it_interval; in bump_cpu_timer()
144 timer->it.cpu.node.expires += incr; in bump_cpu_timer()
145 timer->it_overrun += 1LL << i; in bump_cpu_timer()
148 return timer->it.cpu.node.expires; in bump_cpu_timer()
[all …]
Dposix-timers.c122 struct k_itimer *timer; in __posix_timers_find() local
124 hlist_for_each_entry_rcu(timer, head, t_hash, in __posix_timers_find()
126 if ((timer->it_signal == sig) && (timer->it_id == id)) in __posix_timers_find()
127 return timer; in __posix_timers_find()
140 static int posix_timer_add(struct k_itimer *timer) in posix_timer_add() argument
151 hlist_add_head_rcu(&timer->t_hash, head); in posix_timer_add()
295 struct hrtimer *timer = &timr->it.real.timer; in common_hrtimer_rearm() local
297 timr->it_overrun += hrtimer_forward(timer, timer->base->get_time(), in common_hrtimer_rearm()
299 hrtimer_restart(timer); in common_hrtimer_rearm()
366 static enum hrtimer_restart posix_timer_fn(struct hrtimer *timer) in posix_timer_fn() argument
[all …]
Dtimer_list.c46 print_timer(struct seq_file *m, struct hrtimer *taddr, struct hrtimer *timer, in print_timer() argument
49 SEQ_printf(m, " #%d: <%pK>, %ps", idx, taddr, timer->function); in print_timer()
50 SEQ_printf(m, ", S:%02x", timer->state); in print_timer()
53 (unsigned long long)ktime_to_ns(hrtimer_get_softexpires(timer)), in print_timer()
54 (unsigned long long)ktime_to_ns(hrtimer_get_expires(timer)), in print_timer()
55 (long long)(ktime_to_ns(hrtimer_get_softexpires(timer)) - now), in print_timer()
56 (long long)(ktime_to_ns(hrtimer_get_expires(timer)) - now)); in print_timer()
63 struct hrtimer *timer, tmp; in print_active_timers() local
87 timer = container_of(curr, struct hrtimer, node); in print_active_timers()
88 tmp = *timer; in print_active_timers()
[all …]
Ditimer.c29 static struct timespec64 itimer_get_remtime(struct hrtimer *timer) in itimer_get_remtime() argument
31 ktime_t rem = __hrtimer_get_remaining(timer, true); in itimer_get_remtime()
38 if (hrtimer_active(timer)) { in itimer_get_remtime()
156 enum hrtimer_restart it_real_fn(struct hrtimer *timer) in it_real_fn() argument
159 container_of(timer, struct signal_struct, real_timer); in it_real_fn()
210 struct hrtimer *timer; in do_setitimer() local
217 timer = &tsk->signal->real_timer; in do_setitimer()
219 ovalue->it_value = itimer_get_remtime(timer); in do_setitimer()
224 if (hrtimer_try_to_cancel(timer) < 0) { in do_setitimer()
226 hrtimer_cancel_wait_running(timer); in do_setitimer()
[all …]
Dalarmtimer.c197 static enum hrtimer_restart alarmtimer_fired(struct hrtimer *timer) in alarmtimer_fired() argument
199 struct alarm *alarm = container_of(timer, struct alarm, timer); in alarmtimer_fired()
214 hrtimer_set_expires(&alarm->timer, alarm->node.expires); in alarmtimer_fired()
330 alarm->timer.function = alarmtimer_fired; in __alarm_init()
345 hrtimer_init(&alarm->timer, alarm_bases[type].base_clockid, in alarm_init()
364 hrtimer_start(&alarm->timer, alarm->node.expires, HRTIMER_MODE_ABS); in alarm_start()
391 hrtimer_set_expires(&alarm->timer, alarm->node.expires); in alarm_restart()
392 hrtimer_restart(&alarm->timer); in alarm_restart()
412 ret = hrtimer_try_to_cancel(&alarm->timer); in alarm_try_to_cancel()
435 hrtimer_cancel_wait_running(&alarm->timer); in alarm_cancel()
[all …]
DKconfig52 # and not from the timer interrupt context
63 The legacy timer tick helper is used by platforms that
103 bool "Periodic timer ticks (constant rate, no dynticks)"
112 This option enables a tickless idle system: timer interrupts
195 This option enables high resolution timer support. If your
Dposix-timers.h15 int (*timer_create)(struct k_itimer *timer);
45 int common_timer_del(struct k_itimer *timer);
DMakefile2 obj-y += time.o timer.o hrtimer.o
Dtick-sched.c1492 static enum hrtimer_restart tick_sched_timer(struct hrtimer *timer) in tick_sched_timer() argument
1495 container_of(timer, struct tick_sched, sched_timer); in tick_sched_timer()
1514 hrtimer_forward(timer, now, TICK_NSEC); in tick_sched_timer()
/kernel/bpf/
Dhelpers.c1089 struct hrtimer timer; member
1099 struct bpf_hrtimer *timer; member
1111 struct bpf_hrtimer *t = container_of(hrtimer, struct bpf_hrtimer, timer); in bpf_timer_cb()
1148 BPF_CALL_3(bpf_timer_init, struct bpf_timer_kern *, timer, struct bpf_map *, map, in BPF_CALL_3() argument
1168 __bpf_spin_lock_irqsave(&timer->lock); in BPF_CALL_3()
1169 t = timer->timer; in BPF_CALL_3()
1180 t->value = (void *)timer - map->timer_off; in BPF_CALL_3()
1184 hrtimer_init(&t->timer, clockid, HRTIMER_MODE_REL_SOFT); in BPF_CALL_3()
1185 t->timer.function = bpf_timer_cb; in BPF_CALL_3()
1186 WRITE_ONCE(timer->timer, t); in BPF_CALL_3()
[all …]
/kernel/
DKconfig.hz10 Allows the configuration of the timer frequency. It is customary
11 to have the timer interrupt run at 1000 Hz but 100 Hz may be more
14 contention and cacheline bounces as a result of timer interrupts.
15 Note that the timer interrupt occurs on each processor in an SMP
16 environment leading to NR_CPUS * HZ number of timer interrupts
25 too many timer interrupts are occurring.
Dkthread.c1033 struct kthread_delayed_work *dwork = from_timer(dwork, t, timer); in kthread_delayed_work_timer_fn()
1063 struct timer_list *timer = &dwork->timer; in __kthread_queue_delayed_work() local
1066 WARN_ON_ONCE(timer->function != kthread_delayed_work_timer_fn); in __kthread_queue_delayed_work()
1084 timer->expires = jiffies + delay; in __kthread_queue_delayed_work()
1085 add_timer(timer); in __kthread_queue_delayed_work()
1195 del_timer_sync(&dwork->timer); in kthread_cancel_delayed_work_timer()
Dworkqueue.c542 destroy_timer_on_stack(&work->timer); in destroy_delayed_work_on_stack()
1285 if (likely(del_timer(&dwork->timer))) in try_to_grab_pending()
1650 struct delayed_work *dwork = from_timer(dwork, t, timer); in delayed_work_timer_fn()
1660 struct timer_list *timer = &dwork->timer; in __queue_delayed_work() local
1664 WARN_ON_ONCE(timer->function != delayed_work_timer_fn); in __queue_delayed_work()
1665 WARN_ON_ONCE(timer_pending(timer)); in __queue_delayed_work()
1681 timer->expires = jiffies + delay; in __queue_delayed_work()
1684 add_timer_on(timer, cpu); in __queue_delayed_work()
1686 add_timer(timer); in __queue_delayed_work()
3225 if (del_timer_sync(&dwork->timer)) in flush_delayed_work()
/kernel/sched/
Didle.c344 struct hrtimer timer; member
348 static enum hrtimer_restart idle_inject_timer_fn(struct hrtimer *timer) in idle_inject_timer_fn() argument
350 struct idle_timer *it = container_of(timer, struct idle_timer, timer); in idle_inject_timer_fn()
379 hrtimer_init_on_stack(&it.timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_HARD); in play_idle_precise()
380 it.timer.function = idle_inject_timer_fn; in play_idle_precise()
381 hrtimer_start(&it.timer, ns_to_ktime(duration_ns), in play_idle_precise()
Ddeadline.c395 struct hrtimer *timer = &dl_se->inactive_timer; in task_non_contending() local
445 hrtimer_start(timer, ns_to_ktime(zerolag_time), HRTIMER_MODE_REL_HARD); in task_non_contending()
1055 struct hrtimer *timer = &dl_se->dl_timer; in start_dl_timer() local
1068 now = hrtimer_cb_get_time(timer); in start_dl_timer()
1089 if (!hrtimer_is_queued(timer)) { in start_dl_timer()
1091 hrtimer_start(timer, act, HRTIMER_MODE_ABS_HARD); in start_dl_timer()
1110 static enum hrtimer_restart dl_task_timer(struct hrtimer *timer) in dl_task_timer() argument
1112 struct sched_dl_entity *dl_se = container_of(timer, in dl_task_timer()
1219 struct hrtimer *timer = &dl_se->dl_timer; in init_dl_task_timer() local
1221 hrtimer_init(timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_HARD); in init_dl_task_timer()
[all …]
/kernel/trace/
Dtrace_osnoise.c214 struct hrtimer timer; member
1512 static enum hrtimer_restart timerlat_irq(struct hrtimer *timer) in timerlat_irq() argument
1525 tlat = container_of(timer, struct timerlat_variables, timer); in timerlat_irq()
1527 now = ktime_to_ns(hrtimer_cb_get_time(&tlat->timer)); in timerlat_irq()
1620 now = hrtimer_cb_get_time(&tlat->timer); in wait_next_period()
1638 hrtimer_start(&tlat->timer, next_abs_period, HRTIMER_MODE_ABS_PINNED_HARD); in wait_next_period()
1663 hrtimer_init(&tlat->timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS_PINNED_HARD); in timerlat_main()
1664 tlat->timer.function = timerlat_irq; in timerlat_main()
1670 tlat->abs_period = hrtimer_cb_get_time(&tlat->timer); in timerlat_main()
1677 now = ktime_to_ns(hrtimer_cb_get_time(&tlat->timer)); in timerlat_main()
[all …]
DKconfig455 The tracer thread sets a periodic timer to wakeup itself, and goes
456 to sleep waiting for the timer to fire. At the wakeup, the thread
458 the current time and the absolute time that the timer was set
462 timer latency observed at the hardirq context before the
463 activation of the thread. The second is the timer latency observed
/kernel/kcsan/
Dkcsan_test.c1452 static void access_thread_timer(struct timer_list *timer) in access_thread_timer() argument
1469 struct timer_list timer; in access_thread() local
1474 timer_setup_on_stack(&timer, access_thread_timer, 0); in access_thread()
1478 if (!timer_pending(&timer)) in access_thread()
1479 mod_timer(&timer, jiffies + 1); in access_thread()
1489 del_timer_sync(&timer); in access_thread()
1490 destroy_timer_on_stack(&timer); in access_thread()
/kernel/futex/
Dsyscalls.c304 hrtimer_cancel(&to.timer); in SYSCALL_DEFINE5()
305 destroy_hrtimer_on_stack(&to.timer); in SYSCALL_DEFINE5()
Drequeue.c892 hrtimer_cancel(&to->timer); in futex_wait_requeue_pi()
893 destroy_hrtimer_on_stack(&to->timer); in futex_wait_requeue_pi()
Dwaitwake.c696 hrtimer_cancel(&to->timer); in futex_wait()
697 destroy_hrtimer_on_stack(&to->timer); in futex_wait()
Dpi.c1077 hrtimer_cancel(&to->timer); in futex_lock_pi()
1078 destroy_hrtimer_on_stack(&to->timer); in futex_lock_pi()
Dcore.c149 hrtimer_set_expires_range_ns(&timeout->timer, *time, range_ns); in futex_setup_timer()

12