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# The generic clock events infrastructure 20b5e498adSThomas Gleixnerconfig GENERIC_CLOCKEVENTS 210774a6edSArnd Bergmann def_bool !LEGACY_TIMER_TICK 22b5e498adSThomas Gleixner 2312ad1000SMark Rutland# Architecture can handle broadcast in a driver-agnostic way 2412ad1000SMark Rutlandconfig ARCH_HAS_TICK_BROADCAST 2512ad1000SMark Rutland bool 2612ad1000SMark Rutland 27b5e498adSThomas Gleixner# Clockevents broadcasting infrastructure 28b5e498adSThomas Gleixnerconfig GENERIC_CLOCKEVENTS_BROADCAST 29b5e498adSThomas Gleixner bool 30b5e498adSThomas Gleixner depends on GENERIC_CLOCKEVENTS 31b5e498adSThomas Gleixner 322be2a197SThomas Gleixner# Handle broadcast in default_idle_call() 332be2a197SThomas Gleixnerconfig GENERIC_CLOCKEVENTS_BROADCAST_IDLE 342be2a197SThomas Gleixner bool 352be2a197SThomas Gleixner depends on GENERIC_CLOCKEVENTS_BROADCAST 362be2a197SThomas Gleixner 37764e0da1SThomas Gleixner# Automatically adjust the min. reprogramming time for 38764e0da1SThomas Gleixner# clock event device 39764e0da1SThomas Gleixnerconfig GENERIC_CLOCKEVENTS_MIN_ADJUST 40764e0da1SThomas Gleixner bool 41764e0da1SThomas Gleixner 42cd38bdb8SThomas Gleixnerconfig GENERIC_CLOCKEVENTS_COUPLED 43cd38bdb8SThomas Gleixner bool 44cd38bdb8SThomas Gleixner 4589f951a1SThomas Gleixnerconfig GENERIC_CLOCKEVENTS_COUPLED_INLINE 4689f951a1SThomas Gleixner select GENERIC_CLOCKEVENTS_COUPLED 4789f951a1SThomas Gleixner bool 4889f951a1SThomas Gleixner 49b5e498adSThomas Gleixner# Generic update of CMOS clock 50b5e498adSThomas Gleixnerconfig GENERIC_CMOS_UPDATE 51b5e498adSThomas Gleixner bool 52764e0da1SThomas Gleixner 53a43b4856SPeter Zijlstra# Deferred rearming of the hrtimer interrupt 54a43b4856SPeter Zijlstraconfig HRTIMER_REARM_DEFERRED 55*15dd3a94SPeter Zijlstra def_bool y 56*15dd3a94SPeter Zijlstra depends on GENERIC_ENTRY && HAVE_GENERIC_TIF_BITS 57*15dd3a94SPeter Zijlstra depends on HIGH_RES_TIMERS && SCHED_HRTICK 58a43b4856SPeter Zijlstra 591fb497ddSThomas Gleixner# Select to handle posix CPU timers from task_work 601fb497ddSThomas Gleixner# and not from the timer interrupt context 611fb497ddSThomas Gleixnerconfig HAVE_POSIX_CPU_TIMERS_TASK_WORK 621fb497ddSThomas Gleixner bool 631fb497ddSThomas Gleixner 641fb497ddSThomas Gleixnerconfig POSIX_CPU_TIMERS_TASK_WORK 651fb497ddSThomas Gleixner bool 661fb497ddSThomas Gleixner default y if POSIX_TIMERS && HAVE_POSIX_CPU_TIMERS_TASK_WORK 671fb497ddSThomas Gleixner 68b3550164SArnd Bergmannconfig LEGACY_TIMER_TICK 69b3550164SArnd Bergmann bool 70b3550164SArnd Bergmann help 71b3550164SArnd Bergmann The legacy timer tick helper is used by platforms that 72b3550164SArnd Bergmann lack support for the generic clockevent framework. 73b3550164SArnd Bergmann New platforms should use generic clockevents instead. 74b3550164SArnd Bergmann 7527601055SCassio Nericonfig TIME_KUNIT_TEST 7627601055SCassio Neri tristate "KUnit test for kernel/time functions" if !KUNIT_ALL_TESTS 7727601055SCassio Neri depends on KUNIT 7827601055SCassio Neri default KUNIT_ALL_TESTS 7927601055SCassio Neri help 8027601055SCassio Neri Enable this option to test RTC library functions. 8127601055SCassio Neri 8227601055SCassio Neri If unsure, say N. 8327601055SCassio Neri 8424a9c541SFrederic Weisbeckerconfig CONTEXT_TRACKING 8524a9c541SFrederic Weisbecker bool 8624a9c541SFrederic Weisbecker 87e67198ccSFrederic Weisbeckerconfig CONTEXT_TRACKING_IDLE 88e67198ccSFrederic Weisbecker bool 89e67198ccSFrederic Weisbecker select CONTEXT_TRACKING 90e67198ccSFrederic Weisbecker help 91e67198ccSFrederic Weisbecker Tracks idle state on behalf of RCU. 92e67198ccSFrederic Weisbecker 93764e0da1SThomas Gleixnermenu "Timers subsystem" 94764e0da1SThomas Gleixner 959094c72cSAnna-Maria Behnsenif GENERIC_CLOCKEVENTS 963451d024SFrederic Weisbecker# Core internal switch. Selected by NO_HZ_COMMON / HIGH_RES_TIMERS. This is 97764e0da1SThomas Gleixner# only related to the tick functionality. Oneshot clockevent devices 986082a6e4SRandy Dunlap# are supported independent of this. 99764e0da1SThomas Gleixnerconfig TICK_ONESHOT 100764e0da1SThomas Gleixner bool 101764e0da1SThomas Gleixner 1023451d024SFrederic Weisbeckerconfig NO_HZ_COMMON 1033451d024SFrederic Weisbecker bool 1043451d024SFrederic Weisbecker select TICK_ONESHOT 1053451d024SFrederic Weisbecker 1063ca277e4SFrederic Weisbeckerchoice 1073ca277e4SFrederic Weisbecker prompt "Timer tick handling" 1083ca277e4SFrederic Weisbecker default NO_HZ_IDLE if NO_HZ 1093ca277e4SFrederic Weisbecker 1105b533f4fSFrederic Weisbeckerconfig HZ_PERIODIC 1113ca277e4SFrederic Weisbecker bool "Periodic timer ticks (constant rate, no dynticks)" 1123ca277e4SFrederic Weisbecker help 1133ca277e4SFrederic Weisbecker This option keeps the tick running periodically at a constant 1143ca277e4SFrederic Weisbecker rate, even when the CPU doesn't need it. 1153ca277e4SFrederic Weisbecker 1163ca277e4SFrederic Weisbeckerconfig NO_HZ_IDLE 1173ca277e4SFrederic Weisbecker bool "Idle dynticks system (tickless idle)" 1183451d024SFrederic Weisbecker select NO_HZ_COMMON 119764e0da1SThomas Gleixner help 1203ca277e4SFrederic Weisbecker This option enables a tickless idle system: timer interrupts 1213ca277e4SFrederic Weisbecker will only trigger on an as-needed basis when the system is idle. 1223ca277e4SFrederic Weisbecker This is usually interesting for energy saving. 1233ca277e4SFrederic Weisbecker 1243ca277e4SFrederic Weisbecker Most of the time you want to say Y here. 125764e0da1SThomas Gleixner 126c5bfece2SFrederic Weisbeckerconfig NO_HZ_FULL 127fae30dd6SFrederic Weisbecker bool "Full dynticks system (tickless)" 1283451d024SFrederic Weisbecker # NO_HZ_COMMON dependency 129fae30dd6SFrederic Weisbecker # We need at least one periodic CPU for timekeeping 130fae30dd6SFrederic Weisbecker depends on SMP 13124a9c541SFrederic Weisbecker depends on HAVE_CONTEXT_TRACKING_USER 132c58b0df1SFrederic Weisbecker # VIRT_CPU_ACCOUNTING_GEN dependency 133554b0004SKevin Hilman depends on HAVE_VIRT_CPU_ACCOUNTING_GEN 1343451d024SFrederic Weisbecker select NO_HZ_COMMON 135ab71d36dSFrederic Weisbecker select RCU_NOCB_CPU 13676c24fb0SFrederic Weisbecker select IRQ_WORK 137bf29cb23SPaul E. McKenney select CPU_ISOLATION 138a831881bSFrederic Weisbecker help 139a831881bSFrederic Weisbecker Adaptively try to shutdown the tick whenever possible, even when 140a831881bSFrederic Weisbecker the CPU is running tasks. Typically this requires running a single 141a831881bSFrederic Weisbecker task on the CPU. Chances for running tickless are maximized when 142a831881bSFrederic Weisbecker the task mostly runs in userspace and has few kernel activity. 143a831881bSFrederic Weisbecker 144c5bfece2SFrederic Weisbecker You need to fill up the nohz_full boot parameter with the 145176b8906SFrederic Weisbecker desired range of dynticks CPUs to use it. This is implemented at 146176b8906SFrederic Weisbecker the expense of some overhead in user <-> kernel transitions: 147176b8906SFrederic Weisbecker syscalls, exceptions and interrupts. 148a831881bSFrederic Weisbecker 149176b8906SFrederic Weisbecker By default, without passing the nohz_full parameter, this behaves just 150176b8906SFrederic Weisbecker like NO_HZ_IDLE. 151a831881bSFrederic Weisbecker 152176b8906SFrederic Weisbecker If you're a distro say Y. 153a831881bSFrederic Weisbecker 1543ca277e4SFrederic Weisbeckerendchoice 1553ca277e4SFrederic Weisbecker 15624a9c541SFrederic Weisbeckerconfig CONTEXT_TRACKING_USER 157a4cffdadSPaul E. McKenney bool 15824a9c541SFrederic Weisbecker depends on HAVE_CONTEXT_TRACKING_USER 15924a9c541SFrederic Weisbecker select CONTEXT_TRACKING 16024a9c541SFrederic Weisbecker help 16124a9c541SFrederic Weisbecker Track transitions between kernel and user on behalf of RCU and 16224a9c541SFrederic Weisbecker tickless cputime accounting. The former case relies on context 16324a9c541SFrederic Weisbecker tracking to enter/exit RCU extended quiescent states. 164a4cffdadSPaul E. McKenney 16524a9c541SFrederic Weisbeckerconfig CONTEXT_TRACKING_USER_FORCE 16624a9c541SFrederic Weisbecker bool "Force user context tracking" 16724a9c541SFrederic Weisbecker depends on CONTEXT_TRACKING_USER 168a4cffdadSPaul E. McKenney default y if !NO_HZ_FULL 169a4cffdadSPaul E. McKenney help 170a4cffdadSPaul E. McKenney The major pre-requirement for full dynticks to work is to 17124a9c541SFrederic Weisbecker support the user context tracking subsystem. But there are also 172a4cffdadSPaul E. McKenney other dependencies to provide in order to make the full 173a4cffdadSPaul E. McKenney dynticks working. 174a4cffdadSPaul E. McKenney 175a4cffdadSPaul E. McKenney This option stands for testing when an arch implements the 17624a9c541SFrederic Weisbecker user context tracking backend but doesn't yet fulfill all the 177a4cffdadSPaul E. McKenney requirements to make the full dynticks feature working. 178a4cffdadSPaul E. McKenney Without the full dynticks, there is no way to test the support 17924a9c541SFrederic Weisbecker for user context tracking and the subsystems that rely on it: RCU 180a4cffdadSPaul E. McKenney userspace extended quiescent state and tickless cputime 181a4cffdadSPaul E. McKenney accounting. This option copes with the absence of the full 18224a9c541SFrederic Weisbecker dynticks subsystem by forcing the user context tracking on all 183a4cffdadSPaul E. McKenney CPUs in the system. 184a4cffdadSPaul E. McKenney 185a4cffdadSPaul E. McKenney Say Y only if you're working on the development of an 18624a9c541SFrederic Weisbecker architecture backend for the user context tracking. 187a4cffdadSPaul E. McKenney 188a4cffdadSPaul E. McKenney Say N otherwise, this option brings an overhead that you 189a4cffdadSPaul E. McKenney don't want in production. 190a4cffdadSPaul E. McKenney 1910644ca5cSFrederic Weisbeckerconfig NO_HZ 1920644ca5cSFrederic Weisbecker bool "Old Idle dynticks config" 1930644ca5cSFrederic Weisbecker help 1940644ca5cSFrederic Weisbecker This is the old config entry that enables dynticks idle. 1950644ca5cSFrederic Weisbecker We keep it around for a little while to enforce backward 1960644ca5cSFrederic Weisbecker compatibility with older config files. 1970644ca5cSFrederic Weisbecker 198764e0da1SThomas Gleixnerconfig HIGH_RES_TIMERS 199764e0da1SThomas Gleixner bool "High Resolution Timer Support" 200764e0da1SThomas Gleixner select TICK_ONESHOT 201764e0da1SThomas Gleixner help 202764e0da1SThomas Gleixner This option enables high resolution timer support. If your 203764e0da1SThomas Gleixner hardware is not capable then this option only increases 204764e0da1SThomas Gleixner the size of the kernel image. 205764e0da1SThomas Gleixner 2069094c72cSAnna-Maria Behnsenendif 2079094c72cSAnna-Maria Behnsen 2089094c72cSAnna-Maria Behnsenconfig POSIX_AUX_CLOCKS 2099094c72cSAnna-Maria Behnsen bool "Enable auxiliary POSIX clocks" 2109094c72cSAnna-Maria Behnsen depends on POSIX_TIMERS 2119094c72cSAnna-Maria Behnsen help 2129094c72cSAnna-Maria Behnsen Auxiliary POSIX clocks are clocks which can be steered 2139094c72cSAnna-Maria Behnsen independently of the core timekeeper, which controls the 2149094c72cSAnna-Maria Behnsen MONOTONIC, REALTIME, BOOTTIME and TAI clocks. They are useful to 2159094c72cSAnna-Maria Behnsen provide e.g. lockless time accessors to independent PTP clocks 2169094c72cSAnna-Maria Behnsen and other clock domains, which are not correlated to the TAI/NTP 2179094c72cSAnna-Maria Behnsen notion of time. 218fc153c1cSWaiman Long 219764e0da1SThomas Gleixnerendmenu 220