^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) # SPDX-License-Identifier: GPL-2.0-only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) # Timer subsystem related configuration options
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) # Options selectable by arch Kconfig
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) # Watchdog function for clocksources to detect instabilities
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) config CLOCKSOURCE_WATCHDOG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) # Architecture has extra clocksource data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) config ARCH_CLOCKSOURCE_DATA
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) # Architecture has extra clocksource init called from registration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) config ARCH_CLOCKSOURCE_INIT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) # Clocksources require validation of the clocksource against the last
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) # cycle update - x86/TSC misfeature
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) config CLOCKSOURCE_VALIDATE_LAST_CYCLE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) # Timekeeping vsyscall support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) config GENERIC_TIME_VSYSCALL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) # Old style timekeeping
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) config ARCH_USES_GETTIMEOFFSET
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) # The generic clock events infrastructure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) config GENERIC_CLOCKEVENTS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) # Architecture can handle broadcast in a driver-agnostic way
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) config ARCH_HAS_TICK_BROADCAST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) # Clockevents broadcasting infrastructure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) config GENERIC_CLOCKEVENTS_BROADCAST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) depends on GENERIC_CLOCKEVENTS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) # Automatically adjust the min. reprogramming time for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) # clock event device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) config GENERIC_CLOCKEVENTS_MIN_ADJUST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) # Generic update of CMOS clock
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) config GENERIC_CMOS_UPDATE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) # Select to handle posix CPU timers from task_work
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) # and not from the timer interrupt context
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) config HAVE_POSIX_CPU_TIMERS_TASK_WORK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) config POSIX_CPU_TIMERS_TASK_WORK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) default y if POSIX_TIMERS && HAVE_POSIX_CPU_TIMERS_TASK_WORK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) if GENERIC_CLOCKEVENTS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) menu "Timers subsystem"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) # Core internal switch. Selected by NO_HZ_COMMON / HIGH_RES_TIMERS. This is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) # only related to the tick functionality. Oneshot clockevent devices
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) # are supported independent of this.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) config TICK_ONESHOT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) config NO_HZ_COMMON
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) select TICK_ONESHOT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) choice
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) prompt "Timer tick handling"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) default NO_HZ_IDLE if NO_HZ
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) config HZ_PERIODIC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) bool "Periodic timer ticks (constant rate, no dynticks)"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) This option keeps the tick running periodically at a constant
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) rate, even when the CPU doesn't need it.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) config NO_HZ_IDLE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) bool "Idle dynticks system (tickless idle)"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) select NO_HZ_COMMON
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) This option enables a tickless idle system: timer interrupts
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) will only trigger on an as-needed basis when the system is idle.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) This is usually interesting for energy saving.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) Most of the time you want to say Y here.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) config NO_HZ_FULL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) bool "Full dynticks system (tickless)"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) # NO_HZ_COMMON dependency
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) # We need at least one periodic CPU for timekeeping
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) depends on SMP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) depends on HAVE_CONTEXT_TRACKING
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) # VIRT_CPU_ACCOUNTING_GEN dependency
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) depends on HAVE_VIRT_CPU_ACCOUNTING_GEN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) select NO_HZ_COMMON
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) select RCU_NOCB_CPU
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) select VIRT_CPU_ACCOUNTING_GEN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) select IRQ_WORK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) select CPU_ISOLATION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) Adaptively try to shutdown the tick whenever possible, even when
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) the CPU is running tasks. Typically this requires running a single
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) task on the CPU. Chances for running tickless are maximized when
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) the task mostly runs in userspace and has few kernel activity.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) You need to fill up the nohz_full boot parameter with the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) desired range of dynticks CPUs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) This is implemented at the expense of some overhead in user <-> kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) transitions: syscalls, exceptions and interrupts. Even when it's
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) dynamically off.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) Say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) endchoice
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) config CONTEXT_TRACKING
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) config CONTEXT_TRACKING_FORCE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) bool "Force context tracking"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) depends on CONTEXT_TRACKING
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) default y if !NO_HZ_FULL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) The major pre-requirement for full dynticks to work is to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) support the context tracking subsystem. But there are also
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) other dependencies to provide in order to make the full
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) dynticks working.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) This option stands for testing when an arch implements the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) context tracking backend but doesn't yet fullfill all the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) requirements to make the full dynticks feature working.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) Without the full dynticks, there is no way to test the support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) for context tracking and the subsystems that rely on it: RCU
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) userspace extended quiescent state and tickless cputime
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) accounting. This option copes with the absence of the full
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) dynticks subsystem by forcing the context tracking on all
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) CPUs in the system.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) Say Y only if you're working on the development of an
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) architecture backend for the context tracking.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) Say N otherwise, this option brings an overhead that you
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) don't want in production.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) config NO_HZ
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) bool "Old Idle dynticks config"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) This is the old config entry that enables dynticks idle.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) We keep it around for a little while to enforce backward
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) compatibility with older config files.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) config HIGH_RES_TIMERS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) bool "High Resolution Timer Support"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) depends on !ARCH_USES_GETTIMEOFFSET && GENERIC_CLOCKEVENTS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) select TICK_ONESHOT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) This option enables high resolution timer support. If your
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) hardware is not capable then this option only increases
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) the size of the kernel image.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) endmenu
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) endif