xref: /linux/kernel/time/Kconfig (revision f21f7b5162e9dbde6d3d5ce727d4ca2552d76ce9)
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
12d67f34c1SThomas Gleixner# Architecture has extra clocksource init called from registration
13d67f34c1SThomas Gleixnerconfig ARCH_CLOCKSOURCE_INIT
14d67f34c1SThomas Gleixner	bool
15d67f34c1SThomas Gleixner
162e27beebSThomas Gleixnerconfig ARCH_WANTS_CLOCKSOURCE_READ_INLINE
172e27beebSThomas Gleixner	bool
182e27beebSThomas Gleixner
19b5e498adSThomas Gleixner# Timekeeping vsyscall support
20576094b7SJohn Stultzconfig GENERIC_TIME_VSYSCALL
21576094b7SJohn Stultz	bool
22576094b7SJohn Stultz
23b5e498adSThomas Gleixner# The generic clock events infrastructure
24b5e498adSThomas Gleixnerconfig GENERIC_CLOCKEVENTS
250774a6edSArnd Bergmann	def_bool !LEGACY_TIMER_TICK
26b5e498adSThomas Gleixner
2712ad1000SMark Rutland# Architecture can handle broadcast in a driver-agnostic way
2812ad1000SMark Rutlandconfig ARCH_HAS_TICK_BROADCAST
2912ad1000SMark Rutland	bool
3012ad1000SMark Rutland
31b5e498adSThomas Gleixner# Clockevents broadcasting infrastructure
32b5e498adSThomas Gleixnerconfig GENERIC_CLOCKEVENTS_BROADCAST
33b5e498adSThomas Gleixner	bool
34b5e498adSThomas Gleixner	depends on GENERIC_CLOCKEVENTS
35b5e498adSThomas Gleixner
362be2a197SThomas Gleixner# Handle broadcast in default_idle_call()
372be2a197SThomas Gleixnerconfig GENERIC_CLOCKEVENTS_BROADCAST_IDLE
382be2a197SThomas Gleixner	bool
392be2a197SThomas Gleixner	depends on GENERIC_CLOCKEVENTS_BROADCAST
402be2a197SThomas Gleixner
41764e0da1SThomas Gleixner# Automatically adjust the min. reprogramming time for
42764e0da1SThomas Gleixner# clock event device
43764e0da1SThomas Gleixnerconfig GENERIC_CLOCKEVENTS_MIN_ADJUST
44764e0da1SThomas Gleixner	bool
45764e0da1SThomas Gleixner
46cd38bdb8SThomas Gleixnerconfig GENERIC_CLOCKEVENTS_COUPLED
47cd38bdb8SThomas Gleixner	bool
48cd38bdb8SThomas Gleixner
4989f951a1SThomas Gleixnerconfig GENERIC_CLOCKEVENTS_COUPLED_INLINE
5089f951a1SThomas Gleixner	select GENERIC_CLOCKEVENTS_COUPLED
5189f951a1SThomas Gleixner	bool
5289f951a1SThomas Gleixner
53b5e498adSThomas Gleixner# Generic update of CMOS clock
54b5e498adSThomas Gleixnerconfig GENERIC_CMOS_UPDATE
55b5e498adSThomas Gleixner	bool
56764e0da1SThomas Gleixner
57a43b4856SPeter Zijlstra# Deferred rearming of the hrtimer interrupt
58a43b4856SPeter Zijlstraconfig HRTIMER_REARM_DEFERRED
59*15dd3a94SPeter Zijlstra       def_bool y
60*15dd3a94SPeter Zijlstra       depends on GENERIC_ENTRY && HAVE_GENERIC_TIF_BITS
61*15dd3a94SPeter Zijlstra       depends on HIGH_RES_TIMERS && SCHED_HRTICK
62a43b4856SPeter Zijlstra
631fb497ddSThomas Gleixner# Select to handle posix CPU timers from task_work
641fb497ddSThomas Gleixner# and not from the timer interrupt context
651fb497ddSThomas Gleixnerconfig HAVE_POSIX_CPU_TIMERS_TASK_WORK
661fb497ddSThomas Gleixner	bool
671fb497ddSThomas Gleixner
681fb497ddSThomas Gleixnerconfig POSIX_CPU_TIMERS_TASK_WORK
691fb497ddSThomas Gleixner	bool
701fb497ddSThomas Gleixner	default y if POSIX_TIMERS && HAVE_POSIX_CPU_TIMERS_TASK_WORK
711fb497ddSThomas Gleixner
72b3550164SArnd Bergmannconfig LEGACY_TIMER_TICK
73b3550164SArnd Bergmann	bool
74b3550164SArnd Bergmann	help
75b3550164SArnd Bergmann	  The legacy timer tick helper is used by platforms that
76b3550164SArnd Bergmann	  lack support for the generic clockevent framework.
77b3550164SArnd Bergmann	  New platforms should use generic clockevents instead.
78b3550164SArnd Bergmann
7927601055SCassio Nericonfig TIME_KUNIT_TEST
8027601055SCassio Neri	tristate "KUnit test for kernel/time functions" if !KUNIT_ALL_TESTS
8127601055SCassio Neri	depends on KUNIT
8227601055SCassio Neri	default KUNIT_ALL_TESTS
8327601055SCassio Neri	help
8427601055SCassio Neri	  Enable this option to test RTC library functions.
8527601055SCassio Neri
8627601055SCassio Neri	  If unsure, say N.
8727601055SCassio Neri
8824a9c541SFrederic Weisbeckerconfig CONTEXT_TRACKING
8924a9c541SFrederic Weisbecker	bool
9024a9c541SFrederic Weisbecker
91e67198ccSFrederic Weisbeckerconfig CONTEXT_TRACKING_IDLE
92e67198ccSFrederic Weisbecker	bool
93e67198ccSFrederic Weisbecker	select CONTEXT_TRACKING
94e67198ccSFrederic Weisbecker	help
95e67198ccSFrederic Weisbecker	  Tracks idle state on behalf of RCU.
96e67198ccSFrederic Weisbecker
97764e0da1SThomas Gleixnermenu "Timers subsystem"
98764e0da1SThomas Gleixner
999094c72cSAnna-Maria Behnsenif GENERIC_CLOCKEVENTS
1003451d024SFrederic Weisbecker# Core internal switch. Selected by NO_HZ_COMMON / HIGH_RES_TIMERS. This is
101764e0da1SThomas Gleixner# only related to the tick functionality. Oneshot clockevent devices
1026082a6e4SRandy Dunlap# are supported independent of this.
103764e0da1SThomas Gleixnerconfig TICK_ONESHOT
104764e0da1SThomas Gleixner	bool
105764e0da1SThomas Gleixner
1063451d024SFrederic Weisbeckerconfig NO_HZ_COMMON
1073451d024SFrederic Weisbecker	bool
1083451d024SFrederic Weisbecker	select TICK_ONESHOT
1093451d024SFrederic Weisbecker
1103ca277e4SFrederic Weisbeckerchoice
1113ca277e4SFrederic Weisbecker	prompt "Timer tick handling"
1123ca277e4SFrederic Weisbecker	default NO_HZ_IDLE if NO_HZ
1133ca277e4SFrederic Weisbecker
1145b533f4fSFrederic Weisbeckerconfig HZ_PERIODIC
1153ca277e4SFrederic Weisbecker	bool "Periodic timer ticks (constant rate, no dynticks)"
1163ca277e4SFrederic Weisbecker	help
1173ca277e4SFrederic Weisbecker	  This option keeps the tick running periodically at a constant
1183ca277e4SFrederic Weisbecker	  rate, even when the CPU doesn't need it.
1193ca277e4SFrederic Weisbecker
1203ca277e4SFrederic Weisbeckerconfig NO_HZ_IDLE
1213ca277e4SFrederic Weisbecker	bool "Idle dynticks system (tickless idle)"
1223451d024SFrederic Weisbecker	select NO_HZ_COMMON
123764e0da1SThomas Gleixner	help
1243ca277e4SFrederic Weisbecker	  This option enables a tickless idle system: timer interrupts
1253ca277e4SFrederic Weisbecker	  will only trigger on an as-needed basis when the system is idle.
1263ca277e4SFrederic Weisbecker	  This is usually interesting for energy saving.
1273ca277e4SFrederic Weisbecker
1283ca277e4SFrederic Weisbecker	  Most of the time you want to say Y here.
129764e0da1SThomas Gleixner
130c5bfece2SFrederic Weisbeckerconfig NO_HZ_FULL
131fae30dd6SFrederic Weisbecker	bool "Full dynticks system (tickless)"
1323451d024SFrederic Weisbecker	# NO_HZ_COMMON dependency
133fae30dd6SFrederic Weisbecker	# We need at least one periodic CPU for timekeeping
134fae30dd6SFrederic Weisbecker	depends on SMP
13524a9c541SFrederic Weisbecker	depends on HAVE_CONTEXT_TRACKING_USER
136c58b0df1SFrederic Weisbecker	# VIRT_CPU_ACCOUNTING_GEN dependency
137554b0004SKevin Hilman	depends on HAVE_VIRT_CPU_ACCOUNTING_GEN
1383451d024SFrederic Weisbecker	select NO_HZ_COMMON
139ab71d36dSFrederic Weisbecker	select RCU_NOCB_CPU
140c58b0df1SFrederic Weisbecker	select VIRT_CPU_ACCOUNTING_GEN
14176c24fb0SFrederic Weisbecker	select IRQ_WORK
142bf29cb23SPaul E. McKenney	select CPU_ISOLATION
143a831881bSFrederic Weisbecker	help
144a831881bSFrederic Weisbecker	 Adaptively try to shutdown the tick whenever possible, even when
145a831881bSFrederic Weisbecker	 the CPU is running tasks. Typically this requires running a single
146a831881bSFrederic Weisbecker	 task on the CPU. Chances for running tickless are maximized when
147a831881bSFrederic Weisbecker	 the task mostly runs in userspace and has few kernel activity.
148a831881bSFrederic Weisbecker
149c5bfece2SFrederic Weisbecker	 You need to fill up the nohz_full boot parameter with the
150176b8906SFrederic Weisbecker	 desired range of dynticks CPUs to use it. This is implemented at
151176b8906SFrederic Weisbecker	 the expense of some overhead in user <-> kernel transitions:
152176b8906SFrederic Weisbecker	 syscalls, exceptions and interrupts.
153a831881bSFrederic Weisbecker
154176b8906SFrederic Weisbecker	 By default, without passing the nohz_full parameter, this behaves just
155176b8906SFrederic Weisbecker	 like NO_HZ_IDLE.
156a831881bSFrederic Weisbecker
157176b8906SFrederic Weisbecker	 If you're a distro say Y.
158a831881bSFrederic Weisbecker
1593ca277e4SFrederic Weisbeckerendchoice
1603ca277e4SFrederic Weisbecker
16124a9c541SFrederic Weisbeckerconfig CONTEXT_TRACKING_USER
162a4cffdadSPaul E. McKenney	bool
16324a9c541SFrederic Weisbecker	depends on HAVE_CONTEXT_TRACKING_USER
16424a9c541SFrederic Weisbecker	select CONTEXT_TRACKING
16524a9c541SFrederic Weisbecker	help
16624a9c541SFrederic Weisbecker	  Track transitions between kernel and user on behalf of RCU and
16724a9c541SFrederic Weisbecker	  tickless cputime accounting. The former case relies on context
16824a9c541SFrederic Weisbecker	  tracking to enter/exit RCU extended quiescent states.
169a4cffdadSPaul E. McKenney
17024a9c541SFrederic Weisbeckerconfig CONTEXT_TRACKING_USER_FORCE
17124a9c541SFrederic Weisbecker	bool "Force user context tracking"
17224a9c541SFrederic Weisbecker	depends on CONTEXT_TRACKING_USER
173a4cffdadSPaul E. McKenney	default y if !NO_HZ_FULL
174a4cffdadSPaul E. McKenney	help
175a4cffdadSPaul E. McKenney	  The major pre-requirement for full dynticks to work is to
17624a9c541SFrederic Weisbecker	  support the user context tracking subsystem. But there are also
177a4cffdadSPaul E. McKenney	  other dependencies to provide in order to make the full
178a4cffdadSPaul E. McKenney	  dynticks working.
179a4cffdadSPaul E. McKenney
180a4cffdadSPaul E. McKenney	  This option stands for testing when an arch implements the
18124a9c541SFrederic Weisbecker	  user context tracking backend but doesn't yet fulfill all the
182a4cffdadSPaul E. McKenney	  requirements to make the full dynticks feature working.
183a4cffdadSPaul E. McKenney	  Without the full dynticks, there is no way to test the support
18424a9c541SFrederic Weisbecker	  for user context tracking and the subsystems that rely on it: RCU
185a4cffdadSPaul E. McKenney	  userspace extended quiescent state and tickless cputime
186a4cffdadSPaul E. McKenney	  accounting. This option copes with the absence of the full
18724a9c541SFrederic Weisbecker	  dynticks subsystem by forcing the user context tracking on all
188a4cffdadSPaul E. McKenney	  CPUs in the system.
189a4cffdadSPaul E. McKenney
190a4cffdadSPaul E. McKenney	  Say Y only if you're working on the development of an
19124a9c541SFrederic Weisbecker	  architecture backend for the user context tracking.
192a4cffdadSPaul E. McKenney
193a4cffdadSPaul E. McKenney	  Say N otherwise, this option brings an overhead that you
194a4cffdadSPaul E. McKenney	  don't want in production.
195a4cffdadSPaul E. McKenney
1960644ca5cSFrederic Weisbeckerconfig NO_HZ
1970644ca5cSFrederic Weisbecker	bool "Old Idle dynticks config"
1980644ca5cSFrederic Weisbecker	help
1990644ca5cSFrederic Weisbecker	  This is the old config entry that enables dynticks idle.
2000644ca5cSFrederic Weisbecker	  We keep it around for a little while to enforce backward
2010644ca5cSFrederic Weisbecker	  compatibility with older config files.
2020644ca5cSFrederic Weisbecker
203764e0da1SThomas Gleixnerconfig HIGH_RES_TIMERS
204764e0da1SThomas Gleixner	bool "High Resolution Timer Support"
205764e0da1SThomas Gleixner	select TICK_ONESHOT
206764e0da1SThomas Gleixner	help
207764e0da1SThomas Gleixner	  This option enables high resolution timer support. If your
208764e0da1SThomas Gleixner	  hardware is not capable then this option only increases
209764e0da1SThomas Gleixner	  the size of the kernel image.
210764e0da1SThomas Gleixner
2119094c72cSAnna-Maria Behnsenendif
2129094c72cSAnna-Maria Behnsen
2139094c72cSAnna-Maria Behnsenconfig POSIX_AUX_CLOCKS
2149094c72cSAnna-Maria Behnsen	bool "Enable auxiliary POSIX clocks"
2159094c72cSAnna-Maria Behnsen	depends on POSIX_TIMERS
2169094c72cSAnna-Maria Behnsen	help
2179094c72cSAnna-Maria Behnsen	  Auxiliary POSIX clocks are clocks which can be steered
2189094c72cSAnna-Maria Behnsen	  independently of the core timekeeper, which controls the
2199094c72cSAnna-Maria Behnsen	  MONOTONIC, REALTIME, BOOTTIME and TAI clocks.  They are useful to
2209094c72cSAnna-Maria Behnsen	  provide e.g. lockless time accessors to independent PTP clocks
2219094c72cSAnna-Maria Behnsen	  and other clock domains, which are not correlated to the TAI/NTP
2229094c72cSAnna-Maria Behnsen	  notion of time.
223fc153c1cSWaiman Long
224764e0da1SThomas Gleixnerendmenu
225