xref: /linux/kernel/time/Kconfig (revision 15dd3a9488557d3e6ebcecacab79f4e56b69ab54)
1ec8f24b7SThomas Gleixner# SPDX-License-Identifier: GPL-2.0-only
279bf2bb3SThomas Gleixner#
379bf2bb3SThomas Gleixner# Timer subsystem related configuration options
479bf2bb3SThomas Gleixner#
53872c48bSThomas Gleixner
6b5e498adSThomas Gleixner# Options selectable by arch Kconfig
7b5e498adSThomas Gleixner
8b5e498adSThomas Gleixner# Watchdog function for clocksources to detect instabilities
9b5e498adSThomas Gleixnerconfig CLOCKSOURCE_WATCHDOG
10b5e498adSThomas Gleixner	bool
11b5e498adSThomas Gleixner
12b5e498adSThomas Gleixner# Architecture has extra clocksource data
13b5e498adSThomas Gleixnerconfig ARCH_CLOCKSOURCE_DATA
14b5e498adSThomas Gleixner	bool
15b5e498adSThomas Gleixner
16d67f34c1SThomas Gleixner# Architecture has extra clocksource init called from registration
17d67f34c1SThomas Gleixnerconfig ARCH_CLOCKSOURCE_INIT
18d67f34c1SThomas Gleixner	bool
19d67f34c1SThomas Gleixner
202e27beebSThomas Gleixnerconfig ARCH_WANTS_CLOCKSOURCE_READ_INLINE
212e27beebSThomas Gleixner	bool
222e27beebSThomas Gleixner
23b5e498adSThomas Gleixner# Timekeeping vsyscall support
24576094b7SJohn Stultzconfig GENERIC_TIME_VSYSCALL
25576094b7SJohn Stultz	bool
26576094b7SJohn Stultz
27b5e498adSThomas Gleixner# The generic clock events infrastructure
28b5e498adSThomas Gleixnerconfig GENERIC_CLOCKEVENTS
290774a6edSArnd Bergmann	def_bool !LEGACY_TIMER_TICK
30b5e498adSThomas Gleixner
3112ad1000SMark Rutland# Architecture can handle broadcast in a driver-agnostic way
3212ad1000SMark Rutlandconfig ARCH_HAS_TICK_BROADCAST
3312ad1000SMark Rutland	bool
3412ad1000SMark Rutland
35b5e498adSThomas Gleixner# Clockevents broadcasting infrastructure
36b5e498adSThomas Gleixnerconfig GENERIC_CLOCKEVENTS_BROADCAST
37b5e498adSThomas Gleixner	bool
38b5e498adSThomas Gleixner	depends on GENERIC_CLOCKEVENTS
39b5e498adSThomas Gleixner
402be2a197SThomas Gleixner# Handle broadcast in default_idle_call()
412be2a197SThomas Gleixnerconfig GENERIC_CLOCKEVENTS_BROADCAST_IDLE
422be2a197SThomas Gleixner	bool
432be2a197SThomas Gleixner	depends on GENERIC_CLOCKEVENTS_BROADCAST
442be2a197SThomas Gleixner
45764e0da1SThomas Gleixner# Automatically adjust the min. reprogramming time for
46764e0da1SThomas Gleixner# clock event device
47764e0da1SThomas Gleixnerconfig GENERIC_CLOCKEVENTS_MIN_ADJUST
48764e0da1SThomas Gleixner	bool
49764e0da1SThomas Gleixner
50cd38bdb8SThomas Gleixnerconfig GENERIC_CLOCKEVENTS_COUPLED
51cd38bdb8SThomas Gleixner	bool
52cd38bdb8SThomas Gleixner
5389f951a1SThomas Gleixnerconfig GENERIC_CLOCKEVENTS_COUPLED_INLINE
5489f951a1SThomas Gleixner	select GENERIC_CLOCKEVENTS_COUPLED
5589f951a1SThomas Gleixner	bool
5689f951a1SThomas Gleixner
57b5e498adSThomas Gleixner# Generic update of CMOS clock
58b5e498adSThomas Gleixnerconfig GENERIC_CMOS_UPDATE
59b5e498adSThomas Gleixner	bool
60764e0da1SThomas Gleixner
61a43b4856SPeter Zijlstra# Deferred rearming of the hrtimer interrupt
62a43b4856SPeter Zijlstraconfig HRTIMER_REARM_DEFERRED
63*15dd3a94SPeter Zijlstra       def_bool y
64*15dd3a94SPeter Zijlstra       depends on GENERIC_ENTRY && HAVE_GENERIC_TIF_BITS
65*15dd3a94SPeter Zijlstra       depends on HIGH_RES_TIMERS && SCHED_HRTICK
66a43b4856SPeter Zijlstra
671fb497ddSThomas Gleixner# Select to handle posix CPU timers from task_work
681fb497ddSThomas Gleixner# and not from the timer interrupt context
691fb497ddSThomas Gleixnerconfig HAVE_POSIX_CPU_TIMERS_TASK_WORK
701fb497ddSThomas Gleixner	bool
711fb497ddSThomas Gleixner
721fb497ddSThomas Gleixnerconfig POSIX_CPU_TIMERS_TASK_WORK
731fb497ddSThomas Gleixner	bool
741fb497ddSThomas Gleixner	default y if POSIX_TIMERS && HAVE_POSIX_CPU_TIMERS_TASK_WORK
751fb497ddSThomas Gleixner
76b3550164SArnd Bergmannconfig LEGACY_TIMER_TICK
77b3550164SArnd Bergmann	bool
78b3550164SArnd Bergmann	help
79b3550164SArnd Bergmann	  The legacy timer tick helper is used by platforms that
80b3550164SArnd Bergmann	  lack support for the generic clockevent framework.
81b3550164SArnd Bergmann	  New platforms should use generic clockevents instead.
82b3550164SArnd Bergmann
8327601055SCassio Nericonfig TIME_KUNIT_TEST
8427601055SCassio Neri	tristate "KUnit test for kernel/time functions" if !KUNIT_ALL_TESTS
8527601055SCassio Neri	depends on KUNIT
8627601055SCassio Neri	default KUNIT_ALL_TESTS
8727601055SCassio Neri	help
8827601055SCassio Neri	  Enable this option to test RTC library functions.
8927601055SCassio Neri
9027601055SCassio Neri	  If unsure, say N.
9127601055SCassio Neri
9224a9c541SFrederic Weisbeckerconfig CONTEXT_TRACKING
9324a9c541SFrederic Weisbecker	bool
9424a9c541SFrederic Weisbecker
95e67198ccSFrederic Weisbeckerconfig CONTEXT_TRACKING_IDLE
96e67198ccSFrederic Weisbecker	bool
97e67198ccSFrederic Weisbecker	select CONTEXT_TRACKING
98e67198ccSFrederic Weisbecker	help
99e67198ccSFrederic Weisbecker	  Tracks idle state on behalf of RCU.
100e67198ccSFrederic Weisbecker
101764e0da1SThomas Gleixnermenu "Timers subsystem"
102764e0da1SThomas Gleixner
1039094c72cSAnna-Maria Behnsenif GENERIC_CLOCKEVENTS
1043451d024SFrederic Weisbecker# Core internal switch. Selected by NO_HZ_COMMON / HIGH_RES_TIMERS. This is
105764e0da1SThomas Gleixner# only related to the tick functionality. Oneshot clockevent devices
1066082a6e4SRandy Dunlap# are supported independent of this.
107764e0da1SThomas Gleixnerconfig TICK_ONESHOT
108764e0da1SThomas Gleixner	bool
109764e0da1SThomas Gleixner
1103451d024SFrederic Weisbeckerconfig NO_HZ_COMMON
1113451d024SFrederic Weisbecker	bool
1123451d024SFrederic Weisbecker	select TICK_ONESHOT
1133451d024SFrederic Weisbecker
1143ca277e4SFrederic Weisbeckerchoice
1153ca277e4SFrederic Weisbecker	prompt "Timer tick handling"
1163ca277e4SFrederic Weisbecker	default NO_HZ_IDLE if NO_HZ
1173ca277e4SFrederic Weisbecker
1185b533f4fSFrederic Weisbeckerconfig HZ_PERIODIC
1193ca277e4SFrederic Weisbecker	bool "Periodic timer ticks (constant rate, no dynticks)"
1203ca277e4SFrederic Weisbecker	help
1213ca277e4SFrederic Weisbecker	  This option keeps the tick running periodically at a constant
1223ca277e4SFrederic Weisbecker	  rate, even when the CPU doesn't need it.
1233ca277e4SFrederic Weisbecker
1243ca277e4SFrederic Weisbeckerconfig NO_HZ_IDLE
1253ca277e4SFrederic Weisbecker	bool "Idle dynticks system (tickless idle)"
1263451d024SFrederic Weisbecker	select NO_HZ_COMMON
127764e0da1SThomas Gleixner	help
1283ca277e4SFrederic Weisbecker	  This option enables a tickless idle system: timer interrupts
1293ca277e4SFrederic Weisbecker	  will only trigger on an as-needed basis when the system is idle.
1303ca277e4SFrederic Weisbecker	  This is usually interesting for energy saving.
1313ca277e4SFrederic Weisbecker
1323ca277e4SFrederic Weisbecker	  Most of the time you want to say Y here.
133764e0da1SThomas Gleixner
134c5bfece2SFrederic Weisbeckerconfig NO_HZ_FULL
135fae30dd6SFrederic Weisbecker	bool "Full dynticks system (tickless)"
1363451d024SFrederic Weisbecker	# NO_HZ_COMMON dependency
137fae30dd6SFrederic Weisbecker	# We need at least one periodic CPU for timekeeping
138fae30dd6SFrederic Weisbecker	depends on SMP
13924a9c541SFrederic Weisbecker	depends on HAVE_CONTEXT_TRACKING_USER
140c58b0df1SFrederic Weisbecker	# VIRT_CPU_ACCOUNTING_GEN dependency
141554b0004SKevin Hilman	depends on HAVE_VIRT_CPU_ACCOUNTING_GEN
1423451d024SFrederic Weisbecker	select NO_HZ_COMMON
143ab71d36dSFrederic Weisbecker	select RCU_NOCB_CPU
144c58b0df1SFrederic Weisbecker	select VIRT_CPU_ACCOUNTING_GEN
14576c24fb0SFrederic Weisbecker	select IRQ_WORK
146bf29cb23SPaul E. McKenney	select CPU_ISOLATION
147a831881bSFrederic Weisbecker	help
148a831881bSFrederic Weisbecker	 Adaptively try to shutdown the tick whenever possible, even when
149a831881bSFrederic Weisbecker	 the CPU is running tasks. Typically this requires running a single
150a831881bSFrederic Weisbecker	 task on the CPU. Chances for running tickless are maximized when
151a831881bSFrederic Weisbecker	 the task mostly runs in userspace and has few kernel activity.
152a831881bSFrederic Weisbecker
153c5bfece2SFrederic Weisbecker	 You need to fill up the nohz_full boot parameter with the
154176b8906SFrederic Weisbecker	 desired range of dynticks CPUs to use it. This is implemented at
155176b8906SFrederic Weisbecker	 the expense of some overhead in user <-> kernel transitions:
156176b8906SFrederic Weisbecker	 syscalls, exceptions and interrupts.
157a831881bSFrederic Weisbecker
158176b8906SFrederic Weisbecker	 By default, without passing the nohz_full parameter, this behaves just
159176b8906SFrederic Weisbecker	 like NO_HZ_IDLE.
160a831881bSFrederic Weisbecker
161176b8906SFrederic Weisbecker	 If you're a distro say Y.
162a831881bSFrederic Weisbecker
1633ca277e4SFrederic Weisbeckerendchoice
1643ca277e4SFrederic Weisbecker
16524a9c541SFrederic Weisbeckerconfig CONTEXT_TRACKING_USER
166a4cffdadSPaul E. McKenney	bool
16724a9c541SFrederic Weisbecker	depends on HAVE_CONTEXT_TRACKING_USER
16824a9c541SFrederic Weisbecker	select CONTEXT_TRACKING
16924a9c541SFrederic Weisbecker	help
17024a9c541SFrederic Weisbecker	  Track transitions between kernel and user on behalf of RCU and
17124a9c541SFrederic Weisbecker	  tickless cputime accounting. The former case relies on context
17224a9c541SFrederic Weisbecker	  tracking to enter/exit RCU extended quiescent states.
173a4cffdadSPaul E. McKenney
17424a9c541SFrederic Weisbeckerconfig CONTEXT_TRACKING_USER_FORCE
17524a9c541SFrederic Weisbecker	bool "Force user context tracking"
17624a9c541SFrederic Weisbecker	depends on CONTEXT_TRACKING_USER
177a4cffdadSPaul E. McKenney	default y if !NO_HZ_FULL
178a4cffdadSPaul E. McKenney	help
179a4cffdadSPaul E. McKenney	  The major pre-requirement for full dynticks to work is to
18024a9c541SFrederic Weisbecker	  support the user context tracking subsystem. But there are also
181a4cffdadSPaul E. McKenney	  other dependencies to provide in order to make the full
182a4cffdadSPaul E. McKenney	  dynticks working.
183a4cffdadSPaul E. McKenney
184a4cffdadSPaul E. McKenney	  This option stands for testing when an arch implements the
18524a9c541SFrederic Weisbecker	  user context tracking backend but doesn't yet fulfill all the
186a4cffdadSPaul E. McKenney	  requirements to make the full dynticks feature working.
187a4cffdadSPaul E. McKenney	  Without the full dynticks, there is no way to test the support
18824a9c541SFrederic Weisbecker	  for user context tracking and the subsystems that rely on it: RCU
189a4cffdadSPaul E. McKenney	  userspace extended quiescent state and tickless cputime
190a4cffdadSPaul E. McKenney	  accounting. This option copes with the absence of the full
19124a9c541SFrederic Weisbecker	  dynticks subsystem by forcing the user context tracking on all
192a4cffdadSPaul E. McKenney	  CPUs in the system.
193a4cffdadSPaul E. McKenney
194a4cffdadSPaul E. McKenney	  Say Y only if you're working on the development of an
19524a9c541SFrederic Weisbecker	  architecture backend for the user context tracking.
196a4cffdadSPaul E. McKenney
197a4cffdadSPaul E. McKenney	  Say N otherwise, this option brings an overhead that you
198a4cffdadSPaul E. McKenney	  don't want in production.
199a4cffdadSPaul E. McKenney
2000644ca5cSFrederic Weisbeckerconfig NO_HZ
2010644ca5cSFrederic Weisbecker	bool "Old Idle dynticks config"
2020644ca5cSFrederic Weisbecker	help
2030644ca5cSFrederic Weisbecker	  This is the old config entry that enables dynticks idle.
2040644ca5cSFrederic Weisbecker	  We keep it around for a little while to enforce backward
2050644ca5cSFrederic Weisbecker	  compatibility with older config files.
2060644ca5cSFrederic Weisbecker
207764e0da1SThomas Gleixnerconfig HIGH_RES_TIMERS
208764e0da1SThomas Gleixner	bool "High Resolution Timer Support"
209764e0da1SThomas Gleixner	select TICK_ONESHOT
210764e0da1SThomas Gleixner	help
211764e0da1SThomas Gleixner	  This option enables high resolution timer support. If your
212764e0da1SThomas Gleixner	  hardware is not capable then this option only increases
213764e0da1SThomas Gleixner	  the size of the kernel image.
214764e0da1SThomas Gleixner
215fc153c1cSWaiman Longconfig CLOCKSOURCE_WATCHDOG_MAX_SKEW_US
21654db412eSBorislav Petkov (AMD)	int "Clocksource watchdog maximum allowable skew (in microseconds)"
217fc153c1cSWaiman Long	depends on CLOCKSOURCE_WATCHDOG
218fc153c1cSWaiman Long	range 50 1000
219c37e85c1SPaul E. McKenney	default 125
220fc153c1cSWaiman Long	help
221fc153c1cSWaiman Long	  Specify the maximum amount of allowable watchdog skew in
222fc153c1cSWaiman Long	  microseconds before reporting the clocksource to be unstable.
223c37e85c1SPaul E. McKenney	  The default is based on a half-second clocksource watchdog
224c37e85c1SPaul E. McKenney	  interval and NTP's maximum frequency drift of 500 parts
225c37e85c1SPaul E. McKenney	  per million.	If the clocksource is good enough for NTP,
226c37e85c1SPaul E. McKenney	  it is good enough for the clocksource watchdog!
2279094c72cSAnna-Maria Behnsenendif
2289094c72cSAnna-Maria Behnsen
2299094c72cSAnna-Maria Behnsenconfig POSIX_AUX_CLOCKS
2309094c72cSAnna-Maria Behnsen	bool "Enable auxiliary POSIX clocks"
2319094c72cSAnna-Maria Behnsen	depends on POSIX_TIMERS
2329094c72cSAnna-Maria Behnsen	help
2339094c72cSAnna-Maria Behnsen	  Auxiliary POSIX clocks are clocks which can be steered
2349094c72cSAnna-Maria Behnsen	  independently of the core timekeeper, which controls the
2359094c72cSAnna-Maria Behnsen	  MONOTONIC, REALTIME, BOOTTIME and TAI clocks.  They are useful to
2369094c72cSAnna-Maria Behnsen	  provide e.g. lockless time accessors to independent PTP clocks
2379094c72cSAnna-Maria Behnsen	  and other clock domains, which are not correlated to the TAI/NTP
2389094c72cSAnna-Maria Behnsen	  notion of time.
239fc153c1cSWaiman Long
240764e0da1SThomas Gleixnerendmenu
241