xref: /openbmc/linux/kernel/time/Kconfig (revision 24e4a8c3)
1#
2# Timer subsystem related configuration options
3#
4
5# Options selectable by arch Kconfig
6
7# Watchdog function for clocksources to detect instabilities
8config CLOCKSOURCE_WATCHDOG
9	bool
10
11# Architecture has extra clocksource data
12config ARCH_CLOCKSOURCE_DATA
13	bool
14
15# Timekeeping vsyscall support
16config GENERIC_TIME_VSYSCALL
17	bool
18
19# Timekeeping vsyscall support
20config GENERIC_TIME_VSYSCALL_OLD
21	bool
22
23# Old style timekeeping
24config ARCH_USES_GETTIMEOFFSET
25	bool
26
27# The generic clock events infrastructure
28config GENERIC_CLOCKEVENTS
29	bool
30
31# Migration helper. Builds, but does not invoke
32config GENERIC_CLOCKEVENTS_BUILD
33	bool
34	default y
35	depends on GENERIC_CLOCKEVENTS
36
37# Architecture can handle broadcast in a driver-agnostic way
38config ARCH_HAS_TICK_BROADCAST
39	bool
40
41# Clockevents broadcasting infrastructure
42config GENERIC_CLOCKEVENTS_BROADCAST
43	bool
44	depends on GENERIC_CLOCKEVENTS
45
46# Automatically adjust the min. reprogramming time for
47# clock event device
48config GENERIC_CLOCKEVENTS_MIN_ADJUST
49	bool
50
51# Generic update of CMOS clock
52config GENERIC_CMOS_UPDATE
53	bool
54
55if GENERIC_CLOCKEVENTS
56menu "Timers subsystem"
57
58# Core internal switch. Selected by NO_HZ_COMMON / HIGH_RES_TIMERS. This is
59# only related to the tick functionality. Oneshot clockevent devices
60# are supported independ of this.
61config TICK_ONESHOT
62	bool
63
64config NO_HZ_COMMON
65	bool
66	depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS
67	select TICK_ONESHOT
68
69choice
70	prompt "Timer tick handling"
71	default NO_HZ_IDLE if NO_HZ
72
73config HZ_PERIODIC
74	bool "Periodic timer ticks (constant rate, no dynticks)"
75	help
76	  This option keeps the tick running periodically at a constant
77	  rate, even when the CPU doesn't need it.
78
79config NO_HZ_IDLE
80	bool "Idle dynticks system (tickless idle)"
81	depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS
82	select NO_HZ_COMMON
83	help
84	  This option enables a tickless idle system: timer interrupts
85	  will only trigger on an as-needed basis when the system is idle.
86	  This is usually interesting for energy saving.
87
88	  Most of the time you want to say Y here.
89
90config NO_HZ_FULL
91	bool "Full dynticks system (tickless)"
92	# NO_HZ_COMMON dependency
93	depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS
94	# We need at least one periodic CPU for timekeeping
95	depends on SMP
96	# RCU_USER_QS dependency
97	depends on HAVE_CONTEXT_TRACKING
98	# VIRT_CPU_ACCOUNTING_GEN dependency
99	depends on HAVE_VIRT_CPU_ACCOUNTING_GEN
100	select NO_HZ_COMMON
101	select RCU_USER_QS
102	select RCU_NOCB_CPU
103	select VIRT_CPU_ACCOUNTING_GEN
104	select IRQ_WORK
105	help
106	 Adaptively try to shutdown the tick whenever possible, even when
107	 the CPU is running tasks. Typically this requires running a single
108	 task on the CPU. Chances for running tickless are maximized when
109	 the task mostly runs in userspace and has few kernel activity.
110
111	 You need to fill up the nohz_full boot parameter with the
112	 desired range of dynticks CPUs.
113
114	 This is implemented at the expense of some overhead in user <-> kernel
115	 transitions: syscalls, exceptions and interrupts. Even when it's
116	 dynamically off.
117
118	 Say N.
119
120endchoice
121
122config NO_HZ_FULL_ALL
123       bool "Full dynticks system on all CPUs by default (except CPU 0)"
124       depends on NO_HZ_FULL
125       help
126         If the user doesn't pass the nohz_full boot option to
127	 define the range of full dynticks CPUs, consider that all
128	 CPUs in the system are full dynticks by default.
129	 Note the boot CPU will still be kept outside the range to
130	 handle the timekeeping duty.
131
132config NO_HZ_FULL_SYSIDLE
133	bool "Detect full-system idle state for full dynticks system"
134	depends on NO_HZ_FULL
135	default n
136	help
137	 At least one CPU must keep the scheduling-clock tick running for
138	 timekeeping purposes whenever there is a non-idle CPU, where
139	 "non-idle" also includes dynticks CPUs as long as they are
140	 running non-idle tasks.  Because the underlying adaptive-tick
141	 support cannot distinguish between all CPUs being idle and
142	 all CPUs each running a single task in dynticks mode, the
143	 underlying support simply ensures that there is always a CPU
144	 handling the scheduling-clock tick, whether or not all CPUs
145	 are idle.  This Kconfig option enables scalable detection of
146	 the all-CPUs-idle state, thus allowing the scheduling-clock
147	 tick to be disabled when all CPUs are idle.  Note that scalable
148	 detection of the all-CPUs-idle state means that larger systems
149	 will be slower to declare the all-CPUs-idle state.
150
151	 Say Y if you would like to help debug all-CPUs-idle detection.
152
153	 Say N if you are unsure.
154
155config NO_HZ_FULL_SYSIDLE_SMALL
156	int "Number of CPUs above which large-system approach is used"
157	depends on NO_HZ_FULL_SYSIDLE
158	range 1 NR_CPUS
159	default 8
160	help
161	 The full-system idle detection mechanism takes a lazy approach
162	 on large systems, as is required to attain decent scalability.
163	 However, on smaller systems, scalability is not anywhere near as
164	 large a concern as is energy efficiency.  The sysidle subsystem
165	 therefore uses a fast but non-scalable algorithm for small
166	 systems and a lazier but scalable algorithm for large systems.
167	 This Kconfig parameter defines the number of CPUs in the largest
168	 system that will be considered to be "small".
169
170	 The default value will be fine in most cases.	Battery-powered
171	 systems that (1) enable NO_HZ_FULL_SYSIDLE, (2) have larger
172	 numbers of CPUs, and (3) are suffering from battery-lifetime
173	 problems due to long sysidle latencies might wish to experiment
174	 with larger values for this Kconfig parameter.  On the other
175	 hand, they might be even better served by disabling NO_HZ_FULL
176	 entirely, given that NO_HZ_FULL is intended for HPC and
177	 real-time workloads that at present do not tend to be run on
178	 battery-powered systems.
179
180	 Take the default if you are unsure.
181
182config NO_HZ
183	bool "Old Idle dynticks config"
184	depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS
185	help
186	  This is the old config entry that enables dynticks idle.
187	  We keep it around for a little while to enforce backward
188	  compatibility with older config files.
189
190config HIGH_RES_TIMERS
191	bool "High Resolution Timer Support"
192	depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS
193	select TICK_ONESHOT
194	help
195	  This option enables high resolution timer support. If your
196	  hardware is not capable then this option only increases
197	  the size of the kernel image.
198
199endmenu
200endif
201