1 /* SPDX-License-Identifier: GPL-2.0 */
5 #include <linux/hrtimer.h>
7 enum tick_device_mode {
13 struct clock_event_device *evtdev;
14 enum tick_device_mode mode;
24 * struct tick_sched - sched tick emulation and no idle tick control/stats
25 * @sched_timer: hrtimer to schedule the periodic tick in high
27 * @last_tick: Store the last tick expiry time when the tick
28 * timer is modified for nohz sleeps. This is necessary
29 * to resume the tick timer operation in the timeline
30 * when the CPU returns from nohz sleep.
31 * @next_tick: Next tick to be fired when in dynticks mode.
32 * @tick_stopped: Indicator that the idle tick has been stopped
33 * @idle_jiffies: jiffies at the entry to idle for idle time accounting
34 * @idle_calls: Total number of idle calls
35 * @idle_sleeps: Number of idle calls, where the sched tick was stopped
36 * @idle_entrytime: Time when the idle call was entered
37 * @idle_waketime: Time when the idle was interrupted
38 * @idle_exittime: Time when the idle state was left
39 * @idle_sleeptime: Sum of the time slept in idle with sched tick stopped
40 * @iowait_sleeptime: Sum of the time slept in idle with sched tick stopped, with IO outstanding
41 * @sleep_length: Duration of the current idle sleep
42 * @do_timer_lst: CPU was the last one doing do_timer before going idle
45 struct hrtimer sched_timer;
46 unsigned long check_clocks;
47 enum tick_nohz_mode nohz_mode;
52 unsigned long idle_jiffies;
53 unsigned long idle_calls;
54 unsigned long idle_sleeps;
56 ktime_t idle_entrytime;
57 ktime_t idle_waketime;
58 ktime_t idle_exittime;
59 ktime_t idle_sleeptime;
60 ktime_t iowait_sleeptime;
62 unsigned long last_jiffies;
66 atomic_t tick_dep_mask;
69 extern struct tick_sched *tick_get_tick_sched(int cpu);
71 extern void tick_setup_sched_timer(void);
72 #if defined CONFIG_NO_HZ_COMMON || defined CONFIG_HIGH_RES_TIMERS
73 extern void tick_cancel_sched_timer(int cpu);
75 static inline void tick_cancel_sched_timer(int cpu) { }
78 #ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST
79 extern int __tick_broadcast_oneshot_control(enum tick_broadcast_state state);
82 __tick_broadcast_oneshot_control(enum tick_broadcast_state state)