Commit | Line | Data |
---|---|---|
ec8f24b7 | 1 | # SPDX-License-Identifier: GPL-2.0-only |
cc19ca86 | 2 | |
a8b76910 VS |
3 | config PREEMPT_NONE_BUILD |
4 | bool | |
5 | ||
6 | config PREEMPT_VOLUNTARY_BUILD | |
7 | bool | |
8 | ||
9 | config PREEMPT_BUILD | |
10 | bool | |
11 | select PREEMPTION | |
12 | select UNINLINE_SPIN_UNLOCK if !ARCH_INLINE_SPIN_UNLOCK | |
13 | ||
f8cbd99b IM |
14 | choice |
15 | prompt "Preemption Model" | |
a8b76910 | 16 | default PREEMPT_NONE |
f8cbd99b | 17 | |
a8b76910 | 18 | config PREEMPT_NONE |
f8cbd99b | 19 | bool "No Forced Preemption (Server)" |
a8b76910 | 20 | select PREEMPT_NONE_BUILD if !PREEMPT_DYNAMIC |
f8cbd99b IM |
21 | help |
22 | This is the traditional Linux preemption model, geared towards | |
23 | throughput. It will still provide good latencies most of the | |
24 | time, but there are no guarantees and occasional longer delays | |
25 | are possible. | |
26 | ||
27 | Select this option if you are building a kernel for a server or | |
28 | scientific/computation system, or if you want to maximize the | |
29 | raw processing power of the kernel, irrespective of scheduling | |
30 | latencies. | |
31 | ||
a8b76910 | 32 | config PREEMPT_VOLUNTARY |
f8cbd99b | 33 | bool "Voluntary Kernel Preemption (Desktop)" |
87a4c375 | 34 | depends on !ARCH_NO_PREEMPT |
a8b76910 | 35 | select PREEMPT_VOLUNTARY_BUILD if !PREEMPT_DYNAMIC |
cc19ca86 | 36 | help |
f8cbd99b IM |
37 | This option reduces the latency of the kernel by adding more |
38 | "explicit preemption points" to the kernel code. These new | |
39 | preemption points have been selected to reduce the maximum | |
40 | latency of rescheduling, providing faster application reactions, | |
3dde6ad8 | 41 | at the cost of slightly lower throughput. |
f8cbd99b IM |
42 | |
43 | This allows reaction to interactive events by allowing a | |
44 | low priority process to voluntarily preempt itself even if it | |
45 | is in kernel mode executing a system call. This allows | |
46 | applications to run more 'smoothly' even when the system is | |
cc19ca86 IM |
47 | under load. |
48 | ||
f8cbd99b IM |
49 | Select this if you are building a kernel for a desktop system. |
50 | ||
a8b76910 | 51 | config PREEMPT |
f8cbd99b | 52 | bool "Preemptible Kernel (Low-Latency Desktop)" |
87a4c375 | 53 | depends on !ARCH_NO_PREEMPT |
a8b76910 | 54 | select PREEMPT_BUILD |
f8cbd99b IM |
55 | help |
56 | This option reduces the latency of the kernel by making | |
57 | all kernel code (that is not executing in a critical section) | |
58 | preemptible. This allows reaction to interactive events by | |
59 | permitting a low priority process to be preempted involuntarily | |
60 | even if it is in kernel mode executing a system call and would | |
61 | otherwise not be about to reach a natural preemption point. | |
62 | This allows applications to run more 'smoothly' even when the | |
3dde6ad8 | 63 | system is under load, at the cost of slightly lower throughput |
f8cbd99b IM |
64 | and a slight runtime overhead to kernel code. |
65 | ||
66 | Select this if you are building a kernel for a desktop or | |
67 | embedded system with latency requirements in the milliseconds | |
68 | range. | |
69 | ||
a50a3f4b TG |
70 | config PREEMPT_RT |
71 | bool "Fully Preemptible Kernel (Real-Time)" | |
a8b76910 | 72 | depends on EXPERT && ARCH_SUPPORTS_RT |
b8d33498 | 73 | select PREEMPTION |
a50a3f4b TG |
74 | help |
75 | This option turns the kernel into a real-time kernel by replacing | |
76 | various locking primitives (spinlocks, rwlocks, etc.) with | |
77 | preemptible priority-inheritance aware variants, enforcing | |
78 | interrupt threading and introducing mechanisms to break up long | |
79 | non-preemptible sections. This makes the kernel, except for very | |
d61ca3c2 | 80 | low level and critical code paths (entry code, scheduler, low |
a50a3f4b TG |
81 | level interrupt handling) fully preemptible and brings most |
82 | execution contexts under scheduler control. | |
83 | ||
84 | Select this if you are building a kernel for systems which | |
85 | require real-time guarantees. | |
86 | ||
f8cbd99b | 87 | endchoice |
cc19ca86 | 88 | |
bdd4e85d | 89 | config PREEMPT_COUNT |
72367933 | 90 | bool |
a50a3f4b | 91 | |
b8d33498 | 92 | config PREEMPTION |
a50a3f4b TG |
93 | bool |
94 | select PREEMPT_COUNT | |
6ef869e0 MH |
95 | |
96 | config PREEMPT_DYNAMIC | |
c597bfdd | 97 | bool "Preemption behaviour defined on boot" |
a8b76910 | 98 | depends on HAVE_PREEMPT_DYNAMIC && !PREEMPT_RT |
99cf983c | 99 | select JUMP_LABEL if HAVE_PREEMPT_DYNAMIC_KEY |
a8b76910 | 100 | select PREEMPT_BUILD |
99cf983c | 101 | default y if HAVE_PREEMPT_DYNAMIC_CALL |
6ef869e0 MH |
102 | help |
103 | This option allows to define the preemption model on the kernel | |
104 | command line parameter and thus override the default preemption | |
105 | model defined during compile time. | |
106 | ||
107 | The feature is primarily interesting for Linux distributions which | |
108 | provide a pre-built kernel binary to reduce the number of kernel | |
109 | flavors they offer while still offering different usecases. | |
110 | ||
111 | The runtime overhead is negligible with HAVE_STATIC_CALL_INLINE enabled | |
112 | but if runtime patching is not available for the specific architecture | |
113 | then the potential overhead should be considered. | |
114 | ||
115 | Interesting if you want the same pre-built kernel should be used for | |
116 | both Server and Desktop workloads. | |
9edeaea1 PZ |
117 | |
118 | config SCHED_CORE | |
119 | bool "Core Scheduling for SMT" | |
9edeaea1 | 120 | depends on SCHED_SMT |
7b419f47 PZ |
121 | help |
122 | This option permits Core Scheduling, a means of coordinated task | |
123 | selection across SMT siblings. When enabled -- see | |
124 | prctl(PR_SCHED_CORE) -- task selection ensures that all SMT siblings | |
125 | will execute a task from the same 'core group', forcing idle when no | |
126 | matching task is found. | |
127 | ||
128 | Use of this feature includes: | |
129 | - mitigation of some (not all) SMT side channels; | |
130 | - limiting SMT interference to improve determinism and/or performance. | |
131 | ||
d2343cb8 IM |
132 | SCHED_CORE is default disabled. When it is enabled and unused, |
133 | which is the likely usage by Linux distributions, there should | |
134 | be no measurable impact on performance. | |
7b419f47 | 135 | |
7dd5ad2d | 136 |