^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) choice
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) prompt "Preemption Model"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) default PREEMPT_NONE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) config PREEMPT_NONE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) bool "No Forced Preemption (Server)"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) This is the traditional Linux preemption model, geared towards
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) throughput. It will still provide good latencies most of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) time, but there are no guarantees and occasional longer delays
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) are possible.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) Select this option if you are building a kernel for a server or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) scientific/computation system, or if you want to maximize the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) raw processing power of the kernel, irrespective of scheduling
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) latencies.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) config PREEMPT_VOLUNTARY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) bool "Voluntary Kernel Preemption (Desktop)"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) depends on !ARCH_NO_PREEMPT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) This option reduces the latency of the kernel by adding more
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) "explicit preemption points" to the kernel code. These new
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) preemption points have been selected to reduce the maximum
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) latency of rescheduling, providing faster application reactions,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) at the cost of slightly lower throughput.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) This allows reaction to interactive events by allowing a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) low priority process to voluntarily preempt itself even if it
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) is in kernel mode executing a system call. This allows
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) applications to run more 'smoothly' even when the system is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) under load.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) Select this if you are building a kernel for a desktop system.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) config PREEMPT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) bool "Preemptible Kernel (Low-Latency Desktop)"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) depends on !ARCH_NO_PREEMPT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) select PREEMPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) select UNINLINE_SPIN_UNLOCK if !ARCH_INLINE_SPIN_UNLOCK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) This option reduces the latency of the kernel by making
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) all kernel code (that is not executing in a critical section)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) preemptible. This allows reaction to interactive events by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) permitting a low priority process to be preempted involuntarily
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) even if it is in kernel mode executing a system call and would
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) otherwise not be about to reach a natural preemption point.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) This allows applications to run more 'smoothly' even when the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) system is under load, at the cost of slightly lower throughput
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) and a slight runtime overhead to kernel code.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) Select this if you are building a kernel for a desktop or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) embedded system with latency requirements in the milliseconds
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) range.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) config PREEMPT_RT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) bool "Fully Preemptible Kernel (Real-Time)"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) depends on EXPERT && ARCH_SUPPORTS_RT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) select PREEMPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) This option turns the kernel into a real-time kernel by replacing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) various locking primitives (spinlocks, rwlocks, etc.) with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) preemptible priority-inheritance aware variants, enforcing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) interrupt threading and introducing mechanisms to break up long
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) non-preemptible sections. This makes the kernel, except for very
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) low level and critical code paths (entry code, scheduler, low
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) level interrupt handling) fully preemptible and brings most
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) execution contexts under scheduler control.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) Select this if you are building a kernel for systems which
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) require real-time guarantees.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) endchoice
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) config PREEMPT_COUNT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) config PREEMPTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) select PREEMPT_COUNT