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 2009ec5442SThomas Gleixner# Clocksources require validation of the clocksource against the last 2109ec5442SThomas Gleixner# cycle update - x86/TSC misfeature 2209ec5442SThomas Gleixnerconfig CLOCKSOURCE_VALIDATE_LAST_CYCLE 2309ec5442SThomas Gleixner bool 2409ec5442SThomas Gleixner 25b5e498adSThomas Gleixner# Timekeeping vsyscall support 26576094b7SJohn Stultzconfig GENERIC_TIME_VSYSCALL 27576094b7SJohn Stultz bool 28576094b7SJohn Stultz 29b5e498adSThomas Gleixner# The generic clock events infrastructure 30b5e498adSThomas Gleixnerconfig GENERIC_CLOCKEVENTS 310774a6edSArnd Bergmann def_bool !LEGACY_TIMER_TICK 32b5e498adSThomas Gleixner 3312ad1000SMark Rutland# Architecture can handle broadcast in a driver-agnostic way 3412ad1000SMark Rutlandconfig ARCH_HAS_TICK_BROADCAST 3512ad1000SMark Rutland bool 3612ad1000SMark Rutland 37b5e498adSThomas Gleixner# Clockevents broadcasting infrastructure 38b5e498adSThomas Gleixnerconfig GENERIC_CLOCKEVENTS_BROADCAST 39b5e498adSThomas Gleixner bool 40b5e498adSThomas Gleixner depends on GENERIC_CLOCKEVENTS 41b5e498adSThomas Gleixner 42*2be2a197SThomas Gleixner# Handle broadcast in default_idle_call() 43*2be2a197SThomas Gleixnerconfig GENERIC_CLOCKEVENTS_BROADCAST_IDLE 44*2be2a197SThomas Gleixner bool 45*2be2a197SThomas Gleixner depends on GENERIC_CLOCKEVENTS_BROADCAST 46*2be2a197SThomas Gleixner 47764e0da1SThomas Gleixner# Automatically adjust the min. reprogramming time for 48764e0da1SThomas Gleixner# clock event device 49764e0da1SThomas Gleixnerconfig GENERIC_CLOCKEVENTS_MIN_ADJUST 50764e0da1SThomas Gleixner bool 51764e0da1SThomas Gleixner 52b5e498adSThomas Gleixner# Generic update of CMOS clock 53b5e498adSThomas Gleixnerconfig GENERIC_CMOS_UPDATE 54b5e498adSThomas Gleixner bool 55764e0da1SThomas Gleixner 561fb497ddSThomas Gleixner# Select to handle posix CPU timers from task_work 571fb497ddSThomas Gleixner# and not from the timer interrupt context 581fb497ddSThomas Gleixnerconfig HAVE_POSIX_CPU_TIMERS_TASK_WORK 591fb497ddSThomas Gleixner bool 601fb497ddSThomas Gleixner 611fb497ddSThomas Gleixnerconfig POSIX_CPU_TIMERS_TASK_WORK 621fb497ddSThomas Gleixner bool 631fb497ddSThomas Gleixner default y if POSIX_TIMERS && HAVE_POSIX_CPU_TIMERS_TASK_WORK 641fb497ddSThomas Gleixner 65b3550164SArnd Bergmannconfig LEGACY_TIMER_TICK 66b3550164SArnd Bergmann bool 67b3550164SArnd Bergmann help 68b3550164SArnd Bergmann The legacy timer tick helper is used by platforms that 69b3550164SArnd Bergmann lack support for the generic clockevent framework. 70b3550164SArnd Bergmann New platforms should use generic clockevents instead. 71b3550164SArnd Bergmann 7227601055SCassio Nericonfig TIME_KUNIT_TEST 7327601055SCassio Neri tristate "KUnit test for kernel/time functions" if !KUNIT_ALL_TESTS 7427601055SCassio Neri depends on KUNIT 7527601055SCassio Neri default KUNIT_ALL_TESTS 7627601055SCassio Neri help 7727601055SCassio Neri Enable this option to test RTC library functions. 7827601055SCassio Neri 7927601055SCassio Neri If unsure, say N. 8027601055SCassio Neri 8124a9c541SFrederic Weisbeckerconfig CONTEXT_TRACKING 8224a9c541SFrederic Weisbecker bool 8324a9c541SFrederic Weisbecker 84e67198ccSFrederic Weisbeckerconfig CONTEXT_TRACKING_IDLE 85e67198ccSFrederic Weisbecker bool 86e67198ccSFrederic Weisbecker select CONTEXT_TRACKING 87e67198ccSFrederic Weisbecker help 88e67198ccSFrederic Weisbecker Tracks idle state on behalf of RCU. 89e67198ccSFrederic Weisbecker 90764e0da1SThomas Gleixnerif GENERIC_CLOCKEVENTS 91764e0da1SThomas Gleixnermenu "Timers subsystem" 92764e0da1SThomas Gleixner 933451d024SFrederic Weisbecker# Core internal switch. Selected by NO_HZ_COMMON / HIGH_RES_TIMERS. This is 94764e0da1SThomas Gleixner# only related to the tick functionality. Oneshot clockevent devices 956082a6e4SRandy Dunlap# are supported independent of this. 96764e0da1SThomas Gleixnerconfig TICK_ONESHOT 97764e0da1SThomas Gleixner bool 98764e0da1SThomas Gleixner 993451d024SFrederic Weisbeckerconfig NO_HZ_COMMON 1003451d024SFrederic Weisbecker bool 1013451d024SFrederic Weisbecker select TICK_ONESHOT 1023451d024SFrederic Weisbecker 1033ca277e4SFrederic Weisbeckerchoice 1043ca277e4SFrederic Weisbecker prompt "Timer tick handling" 1053ca277e4SFrederic Weisbecker default NO_HZ_IDLE if NO_HZ 1063ca277e4SFrederic Weisbecker 1075b533f4fSFrederic Weisbeckerconfig HZ_PERIODIC 1083ca277e4SFrederic Weisbecker bool "Periodic timer ticks (constant rate, no dynticks)" 1093ca277e4SFrederic Weisbecker help 1103ca277e4SFrederic Weisbecker This option keeps the tick running periodically at a constant 1113ca277e4SFrederic Weisbecker rate, even when the CPU doesn't need it. 1123ca277e4SFrederic Weisbecker 1133ca277e4SFrederic Weisbeckerconfig NO_HZ_IDLE 1143ca277e4SFrederic Weisbecker bool "Idle dynticks system (tickless idle)" 1153451d024SFrederic Weisbecker select NO_HZ_COMMON 116764e0da1SThomas Gleixner help 1173ca277e4SFrederic Weisbecker This option enables a tickless idle system: timer interrupts 1183ca277e4SFrederic Weisbecker will only trigger on an as-needed basis when the system is idle. 1193ca277e4SFrederic Weisbecker This is usually interesting for energy saving. 1203ca277e4SFrederic Weisbecker 1213ca277e4SFrederic Weisbecker Most of the time you want to say Y here. 122764e0da1SThomas Gleixner 123c5bfece2SFrederic Weisbeckerconfig NO_HZ_FULL 124fae30dd6SFrederic Weisbecker bool "Full dynticks system (tickless)" 1253451d024SFrederic Weisbecker # NO_HZ_COMMON dependency 126fae30dd6SFrederic Weisbecker # We need at least one periodic CPU for timekeeping 127fae30dd6SFrederic Weisbecker depends on SMP 12824a9c541SFrederic Weisbecker depends on HAVE_CONTEXT_TRACKING_USER 129c58b0df1SFrederic Weisbecker # VIRT_CPU_ACCOUNTING_GEN dependency 130554b0004SKevin Hilman depends on HAVE_VIRT_CPU_ACCOUNTING_GEN 1313451d024SFrederic Weisbecker select NO_HZ_COMMON 132ab71d36dSFrederic Weisbecker select RCU_NOCB_CPU 133c58b0df1SFrederic Weisbecker select VIRT_CPU_ACCOUNTING_GEN 13476c24fb0SFrederic Weisbecker select IRQ_WORK 135bf29cb23SPaul E. McKenney select CPU_ISOLATION 136a831881bSFrederic Weisbecker help 137a831881bSFrederic Weisbecker Adaptively try to shutdown the tick whenever possible, even when 138a831881bSFrederic Weisbecker the CPU is running tasks. Typically this requires running a single 139a831881bSFrederic Weisbecker task on the CPU. Chances for running tickless are maximized when 140a831881bSFrederic Weisbecker the task mostly runs in userspace and has few kernel activity. 141a831881bSFrederic Weisbecker 142c5bfece2SFrederic Weisbecker You need to fill up the nohz_full boot parameter with the 143176b8906SFrederic Weisbecker desired range of dynticks CPUs to use it. This is implemented at 144176b8906SFrederic Weisbecker the expense of some overhead in user <-> kernel transitions: 145176b8906SFrederic Weisbecker syscalls, exceptions and interrupts. 146a831881bSFrederic Weisbecker 147176b8906SFrederic Weisbecker By default, without passing the nohz_full parameter, this behaves just 148176b8906SFrederic Weisbecker like NO_HZ_IDLE. 149a831881bSFrederic Weisbecker 150176b8906SFrederic Weisbecker If you're a distro say Y. 151a831881bSFrederic Weisbecker 1523ca277e4SFrederic Weisbeckerendchoice 1533ca277e4SFrederic Weisbecker 15424a9c541SFrederic Weisbeckerconfig CONTEXT_TRACKING_USER 155a4cffdadSPaul E. McKenney bool 15624a9c541SFrederic Weisbecker depends on HAVE_CONTEXT_TRACKING_USER 15724a9c541SFrederic Weisbecker select CONTEXT_TRACKING 15824a9c541SFrederic Weisbecker help 15924a9c541SFrederic Weisbecker Track transitions between kernel and user on behalf of RCU and 16024a9c541SFrederic Weisbecker tickless cputime accounting. The former case relies on context 16124a9c541SFrederic Weisbecker tracking to enter/exit RCU extended quiescent states. 162a4cffdadSPaul E. McKenney 16324a9c541SFrederic Weisbeckerconfig CONTEXT_TRACKING_USER_FORCE 16424a9c541SFrederic Weisbecker bool "Force user context tracking" 16524a9c541SFrederic Weisbecker depends on CONTEXT_TRACKING_USER 166a4cffdadSPaul E. McKenney default y if !NO_HZ_FULL 167a4cffdadSPaul E. McKenney help 168a4cffdadSPaul E. McKenney The major pre-requirement for full dynticks to work is to 16924a9c541SFrederic Weisbecker support the user context tracking subsystem. But there are also 170a4cffdadSPaul E. McKenney other dependencies to provide in order to make the full 171a4cffdadSPaul E. McKenney dynticks working. 172a4cffdadSPaul E. McKenney 173a4cffdadSPaul E. McKenney This option stands for testing when an arch implements the 17424a9c541SFrederic Weisbecker user context tracking backend but doesn't yet fulfill all the 175a4cffdadSPaul E. McKenney requirements to make the full dynticks feature working. 176a4cffdadSPaul E. McKenney Without the full dynticks, there is no way to test the support 17724a9c541SFrederic Weisbecker for user context tracking and the subsystems that rely on it: RCU 178a4cffdadSPaul E. McKenney userspace extended quiescent state and tickless cputime 179a4cffdadSPaul E. McKenney accounting. This option copes with the absence of the full 18024a9c541SFrederic Weisbecker dynticks subsystem by forcing the user context tracking on all 181a4cffdadSPaul E. McKenney CPUs in the system. 182a4cffdadSPaul E. McKenney 183a4cffdadSPaul E. McKenney Say Y only if you're working on the development of an 18424a9c541SFrederic Weisbecker architecture backend for the user context tracking. 185a4cffdadSPaul E. McKenney 186a4cffdadSPaul E. McKenney Say N otherwise, this option brings an overhead that you 187a4cffdadSPaul E. McKenney don't want in production. 188a4cffdadSPaul E. McKenney 1890644ca5cSFrederic Weisbeckerconfig NO_HZ 1900644ca5cSFrederic Weisbecker bool "Old Idle dynticks config" 1910644ca5cSFrederic Weisbecker help 1920644ca5cSFrederic Weisbecker This is the old config entry that enables dynticks idle. 1930644ca5cSFrederic Weisbecker We keep it around for a little while to enforce backward 1940644ca5cSFrederic Weisbecker compatibility with older config files. 1950644ca5cSFrederic Weisbecker 196764e0da1SThomas Gleixnerconfig HIGH_RES_TIMERS 197764e0da1SThomas Gleixner bool "High Resolution Timer Support" 198764e0da1SThomas Gleixner select TICK_ONESHOT 199764e0da1SThomas Gleixner help 200764e0da1SThomas Gleixner This option enables high resolution timer support. If your 201764e0da1SThomas Gleixner hardware is not capable then this option only increases 202764e0da1SThomas Gleixner the size of the kernel image. 203764e0da1SThomas Gleixner 204fc153c1cSWaiman Longconfig CLOCKSOURCE_WATCHDOG_MAX_SKEW_US 205fc153c1cSWaiman Long int "Clocksource watchdog maximum allowable skew (in μs)" 206fc153c1cSWaiman Long depends on CLOCKSOURCE_WATCHDOG 207fc153c1cSWaiman Long range 50 1000 208c37e85c1SPaul E. McKenney default 125 209fc153c1cSWaiman Long help 210fc153c1cSWaiman Long Specify the maximum amount of allowable watchdog skew in 211fc153c1cSWaiman Long microseconds before reporting the clocksource to be unstable. 212c37e85c1SPaul E. McKenney The default is based on a half-second clocksource watchdog 213c37e85c1SPaul E. McKenney interval and NTP's maximum frequency drift of 500 parts 214c37e85c1SPaul E. McKenney per million. If the clocksource is good enough for NTP, 215c37e85c1SPaul E. McKenney it is good enough for the clocksource watchdog! 216fc153c1cSWaiman Long 217764e0da1SThomas Gleixnerendmenu 218764e0da1SThomas Gleixnerendif 219