blob: 60f1bfc3c7b246df3b6fc9d0381e6802471a59ed [file] [log] [blame]
Thomas Gleixnerec8f24b2019-05-19 13:07:45 +01001# SPDX-License-Identifier: GPL-2.0-only
Ingo Molnarcc19ca82005-06-25 14:57:36 -07002
Ingo Molnarf8cbd992005-06-25 14:57:39 -07003choice
4 prompt "Preemption Model"
Frederic Weisbeckerc597bfd2021-09-14 12:31:34 +02005 default PREEMPT_NONE_BEHAVIOUR
Ingo Molnarf8cbd992005-06-25 14:57:39 -07006
Frederic Weisbeckerc597bfd2021-09-14 12:31:34 +02007config PREEMPT_NONE_BEHAVIOUR
Ingo Molnarf8cbd992005-06-25 14:57:39 -07008 bool "No Forced Preemption (Server)"
Frederic Weisbeckerc597bfd2021-09-14 12:31:34 +02009 select PREEMPT_NONE if !PREEMPT_DYNAMIC
Ingo Molnarcc19ca82005-06-25 14:57:36 -070010 help
Ingo Molnarf8cbd992005-06-25 14:57:39 -070011 This is the traditional Linux preemption model, geared towards
12 throughput. It will still provide good latencies most of the
13 time, but there are no guarantees and occasional longer delays
14 are possible.
15
16 Select this option if you are building a kernel for a server or
17 scientific/computation system, or if you want to maximize the
18 raw processing power of the kernel, irrespective of scheduling
19 latencies.
20
Frederic Weisbeckerc597bfd2021-09-14 12:31:34 +020021config PREEMPT_VOLUNTARY_BEHAVIOUR
Ingo Molnarf8cbd992005-06-25 14:57:39 -070022 bool "Voluntary Kernel Preemption (Desktop)"
Christoph Hellwig87a4c372018-07-31 13:39:32 +020023 depends on !ARCH_NO_PREEMPT
Frederic Weisbeckerc597bfd2021-09-14 12:31:34 +020024 select PREEMPT_VOLUNTARY if !PREEMPT_DYNAMIC
Ingo Molnarf8cbd992005-06-25 14:57:39 -070025 help
26 This option reduces the latency of the kernel by adding more
27 "explicit preemption points" to the kernel code. These new
28 preemption points have been selected to reduce the maximum
29 latency of rescheduling, providing faster application reactions,
David Sterba3dde6ad2007-05-09 07:12:20 +020030 at the cost of slightly lower throughput.
Ingo Molnarf8cbd992005-06-25 14:57:39 -070031
32 This allows reaction to interactive events by allowing a
33 low priority process to voluntarily preempt itself even if it
34 is in kernel mode executing a system call. This allows
35 applications to run more 'smoothly' even when the system is
Ingo Molnarcc19ca82005-06-25 14:57:36 -070036 under load.
37
Ingo Molnarf8cbd992005-06-25 14:57:39 -070038 Select this if you are building a kernel for a desktop system.
39
Frederic Weisbeckerc597bfd2021-09-14 12:31:34 +020040config PREEMPT_BEHAVIOUR
Ingo Molnarf8cbd992005-06-25 14:57:39 -070041 bool "Preemptible Kernel (Low-Latency Desktop)"
Christoph Hellwig87a4c372018-07-31 13:39:32 +020042 depends on !ARCH_NO_PREEMPT
Frederic Weisbeckerc597bfd2021-09-14 12:31:34 +020043 select PREEMPT
Ingo Molnarf8cbd992005-06-25 14:57:39 -070044 help
45 This option reduces the latency of the kernel by making
46 all kernel code (that is not executing in a critical section)
47 preemptible. This allows reaction to interactive events by
48 permitting a low priority process to be preempted involuntarily
49 even if it is in kernel mode executing a system call and would
50 otherwise not be about to reach a natural preemption point.
51 This allows applications to run more 'smoothly' even when the
David Sterba3dde6ad2007-05-09 07:12:20 +020052 system is under load, at the cost of slightly lower throughput
Ingo Molnarf8cbd992005-06-25 14:57:39 -070053 and a slight runtime overhead to kernel code.
54
55 Select this if you are building a kernel for a desktop or
56 embedded system with latency requirements in the milliseconds
57 range.
58
Thomas Gleixnera50a3f42019-07-17 22:01:49 +020059config PREEMPT_RT
60 bool "Fully Preemptible Kernel (Real-Time)"
Frederic Weisbeckerc597bfd2021-09-14 12:31:34 +020061 depends on EXPERT && ARCH_SUPPORTS_RT && !PREEMPT_DYNAMIC
Thomas Gleixnerb8d33492019-07-22 17:59:19 +020062 select PREEMPTION
Thomas Gleixnera50a3f42019-07-17 22:01:49 +020063 help
64 This option turns the kernel into a real-time kernel by replacing
65 various locking primitives (spinlocks, rwlocks, etc.) with
66 preemptible priority-inheritance aware variants, enforcing
67 interrupt threading and introducing mechanisms to break up long
68 non-preemptible sections. This makes the kernel, except for very
Srivatsa S. Bhat (VMware)d61ca3c2019-10-25 16:02:07 -070069 low level and critical code paths (entry code, scheduler, low
Thomas Gleixnera50a3f42019-07-17 22:01:49 +020070 level interrupt handling) fully preemptible and brings most
71 execution contexts under scheduler control.
72
73 Select this if you are building a kernel for systems which
74 require real-time guarantees.
75
Ingo Molnarf8cbd992005-06-25 14:57:39 -070076endchoice
Ingo Molnarcc19ca82005-06-25 14:57:36 -070077
Frederic Weisbeckerc597bfd2021-09-14 12:31:34 +020078config PREEMPT_NONE
79 bool
80
81config PREEMPT_VOLUNTARY
82 bool
83
84config PREEMPT
85 bool
86 select PREEMPTION
87 select UNINLINE_SPIN_UNLOCK if !ARCH_INLINE_SPIN_UNLOCK
88
Frederic Weisbeckerbdd4e852011-06-08 01:13:27 +020089config PREEMPT_COUNT
Masahiro Yamada72367932018-12-11 20:00:51 +090090 bool
Thomas Gleixnera50a3f42019-07-17 22:01:49 +020091
Thomas Gleixnerb8d33492019-07-22 17:59:19 +020092config PREEMPTION
Thomas Gleixnera50a3f42019-07-17 22:01:49 +020093 bool
94 select PREEMPT_COUNT
Michal Hocko6ef869e2021-01-18 15:12:19 +010095
96config PREEMPT_DYNAMIC
Frederic Weisbeckerc597bfd2021-09-14 12:31:34 +020097 bool "Preemption behaviour defined on boot"
98 depends on HAVE_PREEMPT_DYNAMIC
99 select PREEMPT
100 default y
Michal Hocko6ef869e2021-01-18 15:12:19 +0100101 help
102 This option allows to define the preemption model on the kernel
103 command line parameter and thus override the default preemption
104 model defined during compile time.
105
106 The feature is primarily interesting for Linux distributions which
107 provide a pre-built kernel binary to reduce the number of kernel
108 flavors they offer while still offering different usecases.
109
110 The runtime overhead is negligible with HAVE_STATIC_CALL_INLINE enabled
111 but if runtime patching is not available for the specific architecture
112 then the potential overhead should be considered.
113
114 Interesting if you want the same pre-built kernel should be used for
115 both Server and Desktop workloads.
Peter Zijlstra9edeaea2020-11-17 18:19:34 -0500116
117config SCHED_CORE
118 bool "Core Scheduling for SMT"
Peter Zijlstra9edeaea2020-11-17 18:19:34 -0500119 depends on SCHED_SMT
Peter Zijlstra7b419f42021-05-25 08:53:28 +0200120 help
121 This option permits Core Scheduling, a means of coordinated task
122 selection across SMT siblings. When enabled -- see
123 prctl(PR_SCHED_CORE) -- task selection ensures that all SMT siblings
124 will execute a task from the same 'core group', forcing idle when no
125 matching task is found.
126
127 Use of this feature includes:
128 - mitigation of some (not all) SMT side channels;
129 - limiting SMT interference to improve determinism and/or performance.
130
Ingo Molnard2343cb2021-06-28 21:55:16 +0200131 SCHED_CORE is default disabled. When it is enabled and unused,
132 which is the likely usage by Linux distributions, there should
133 be no measurable impact on performance.
Peter Zijlstra7b419f42021-05-25 08:53:28 +0200134
Peter Zijlstra9edeaea2020-11-17 18:19:34 -0500135