1ec8f24b7SThomas Gleixner# SPDX-License-Identifier: GPL-2.0-only 2cc19ca86SIngo Molnar 3f8cbd99bSIngo Molnarchoice 4f8cbd99bSIngo Molnar prompt "Preemption Model" 5*c597bfddSFrederic Weisbecker default PREEMPT_NONE_BEHAVIOUR 6f8cbd99bSIngo Molnar 7*c597bfddSFrederic Weisbeckerconfig PREEMPT_NONE_BEHAVIOUR 8f8cbd99bSIngo Molnar bool "No Forced Preemption (Server)" 9*c597bfddSFrederic Weisbecker select PREEMPT_NONE if !PREEMPT_DYNAMIC 10cc19ca86SIngo Molnar help 11f8cbd99bSIngo Molnar This is the traditional Linux preemption model, geared towards 12f8cbd99bSIngo Molnar throughput. It will still provide good latencies most of the 13f8cbd99bSIngo Molnar time, but there are no guarantees and occasional longer delays 14f8cbd99bSIngo Molnar are possible. 15f8cbd99bSIngo Molnar 16f8cbd99bSIngo Molnar Select this option if you are building a kernel for a server or 17f8cbd99bSIngo Molnar scientific/computation system, or if you want to maximize the 18f8cbd99bSIngo Molnar raw processing power of the kernel, irrespective of scheduling 19f8cbd99bSIngo Molnar latencies. 20f8cbd99bSIngo Molnar 21*c597bfddSFrederic Weisbeckerconfig PREEMPT_VOLUNTARY_BEHAVIOUR 22f8cbd99bSIngo Molnar bool "Voluntary Kernel Preemption (Desktop)" 2387a4c375SChristoph Hellwig depends on !ARCH_NO_PREEMPT 24*c597bfddSFrederic Weisbecker select PREEMPT_VOLUNTARY if !PREEMPT_DYNAMIC 25f8cbd99bSIngo Molnar help 26f8cbd99bSIngo Molnar This option reduces the latency of the kernel by adding more 27f8cbd99bSIngo Molnar "explicit preemption points" to the kernel code. These new 28f8cbd99bSIngo Molnar preemption points have been selected to reduce the maximum 29f8cbd99bSIngo Molnar latency of rescheduling, providing faster application reactions, 303dde6ad8SDavid Sterba at the cost of slightly lower throughput. 31f8cbd99bSIngo Molnar 32f8cbd99bSIngo Molnar This allows reaction to interactive events by allowing a 33f8cbd99bSIngo Molnar low priority process to voluntarily preempt itself even if it 34f8cbd99bSIngo Molnar is in kernel mode executing a system call. This allows 35f8cbd99bSIngo Molnar applications to run more 'smoothly' even when the system is 36cc19ca86SIngo Molnar under load. 37cc19ca86SIngo Molnar 38f8cbd99bSIngo Molnar Select this if you are building a kernel for a desktop system. 39f8cbd99bSIngo Molnar 40*c597bfddSFrederic Weisbeckerconfig PREEMPT_BEHAVIOUR 41f8cbd99bSIngo Molnar bool "Preemptible Kernel (Low-Latency Desktop)" 4287a4c375SChristoph Hellwig depends on !ARCH_NO_PREEMPT 43*c597bfddSFrederic Weisbecker select PREEMPT 44f8cbd99bSIngo Molnar help 45f8cbd99bSIngo Molnar This option reduces the latency of the kernel by making 46f8cbd99bSIngo Molnar all kernel code (that is not executing in a critical section) 47f8cbd99bSIngo Molnar preemptible. This allows reaction to interactive events by 48f8cbd99bSIngo Molnar permitting a low priority process to be preempted involuntarily 49f8cbd99bSIngo Molnar even if it is in kernel mode executing a system call and would 50f8cbd99bSIngo Molnar otherwise not be about to reach a natural preemption point. 51f8cbd99bSIngo Molnar This allows applications to run more 'smoothly' even when the 523dde6ad8SDavid Sterba system is under load, at the cost of slightly lower throughput 53f8cbd99bSIngo Molnar and a slight runtime overhead to kernel code. 54f8cbd99bSIngo Molnar 55f8cbd99bSIngo Molnar Select this if you are building a kernel for a desktop or 56f8cbd99bSIngo Molnar embedded system with latency requirements in the milliseconds 57f8cbd99bSIngo Molnar range. 58f8cbd99bSIngo Molnar 59a50a3f4bSThomas Gleixnerconfig PREEMPT_RT 60a50a3f4bSThomas Gleixner bool "Fully Preemptible Kernel (Real-Time)" 61*c597bfddSFrederic Weisbecker depends on EXPERT && ARCH_SUPPORTS_RT && !PREEMPT_DYNAMIC 62b8d33498SThomas Gleixner select PREEMPTION 63a50a3f4bSThomas Gleixner help 64a50a3f4bSThomas Gleixner This option turns the kernel into a real-time kernel by replacing 65a50a3f4bSThomas Gleixner various locking primitives (spinlocks, rwlocks, etc.) with 66a50a3f4bSThomas Gleixner preemptible priority-inheritance aware variants, enforcing 67a50a3f4bSThomas Gleixner interrupt threading and introducing mechanisms to break up long 68a50a3f4bSThomas Gleixner non-preemptible sections. This makes the kernel, except for very 69d61ca3c2SSrivatsa S. Bhat (VMware) low level and critical code paths (entry code, scheduler, low 70a50a3f4bSThomas Gleixner level interrupt handling) fully preemptible and brings most 71a50a3f4bSThomas Gleixner execution contexts under scheduler control. 72a50a3f4bSThomas Gleixner 73a50a3f4bSThomas Gleixner Select this if you are building a kernel for systems which 74a50a3f4bSThomas Gleixner require real-time guarantees. 75a50a3f4bSThomas Gleixner 76f8cbd99bSIngo Molnarendchoice 77cc19ca86SIngo Molnar 78*c597bfddSFrederic Weisbeckerconfig PREEMPT_NONE 79*c597bfddSFrederic Weisbecker bool 80*c597bfddSFrederic Weisbecker 81*c597bfddSFrederic Weisbeckerconfig PREEMPT_VOLUNTARY 82*c597bfddSFrederic Weisbecker bool 83*c597bfddSFrederic Weisbecker 84*c597bfddSFrederic Weisbeckerconfig PREEMPT 85*c597bfddSFrederic Weisbecker bool 86*c597bfddSFrederic Weisbecker select PREEMPTION 87*c597bfddSFrederic Weisbecker select UNINLINE_SPIN_UNLOCK if !ARCH_INLINE_SPIN_UNLOCK 88*c597bfddSFrederic Weisbecker 89bdd4e85dSFrederic Weisbeckerconfig PREEMPT_COUNT 90bdd4e85dSFrederic Weisbecker bool 91a50a3f4bSThomas Gleixner 92b8d33498SThomas Gleixnerconfig PREEMPTION 93a50a3f4bSThomas Gleixner bool 94a50a3f4bSThomas Gleixner select PREEMPT_COUNT 956ef869e0SMichal Hocko 966ef869e0SMichal Hockoconfig PREEMPT_DYNAMIC 97*c597bfddSFrederic Weisbecker bool "Preemption behaviour defined on boot" 98*c597bfddSFrederic Weisbecker depends on HAVE_PREEMPT_DYNAMIC 99*c597bfddSFrederic Weisbecker select PREEMPT 100*c597bfddSFrederic Weisbecker default y 1016ef869e0SMichal Hocko help 1026ef869e0SMichal Hocko This option allows to define the preemption model on the kernel 1036ef869e0SMichal Hocko command line parameter and thus override the default preemption 1046ef869e0SMichal Hocko model defined during compile time. 1056ef869e0SMichal Hocko 1066ef869e0SMichal Hocko The feature is primarily interesting for Linux distributions which 1076ef869e0SMichal Hocko provide a pre-built kernel binary to reduce the number of kernel 1086ef869e0SMichal Hocko flavors they offer while still offering different usecases. 1096ef869e0SMichal Hocko 1106ef869e0SMichal Hocko The runtime overhead is negligible with HAVE_STATIC_CALL_INLINE enabled 1116ef869e0SMichal Hocko but if runtime patching is not available for the specific architecture 1126ef869e0SMichal Hocko then the potential overhead should be considered. 1136ef869e0SMichal Hocko 1146ef869e0SMichal Hocko Interesting if you want the same pre-built kernel should be used for 1156ef869e0SMichal Hocko both Server and Desktop workloads. 1169edeaea1SPeter Zijlstra 1179edeaea1SPeter Zijlstraconfig SCHED_CORE 1189edeaea1SPeter Zijlstra bool "Core Scheduling for SMT" 1199edeaea1SPeter Zijlstra depends on SCHED_SMT 1207b419f47SPeter Zijlstra help 1217b419f47SPeter Zijlstra This option permits Core Scheduling, a means of coordinated task 1227b419f47SPeter Zijlstra selection across SMT siblings. When enabled -- see 1237b419f47SPeter Zijlstra prctl(PR_SCHED_CORE) -- task selection ensures that all SMT siblings 1247b419f47SPeter Zijlstra will execute a task from the same 'core group', forcing idle when no 1257b419f47SPeter Zijlstra matching task is found. 1267b419f47SPeter Zijlstra 1277b419f47SPeter Zijlstra Use of this feature includes: 1287b419f47SPeter Zijlstra - mitigation of some (not all) SMT side channels; 1297b419f47SPeter Zijlstra - limiting SMT interference to improve determinism and/or performance. 1307b419f47SPeter Zijlstra 131d2343cb8SIngo Molnar SCHED_CORE is default disabled. When it is enabled and unused, 132d2343cb8SIngo Molnar which is the likely usage by Linux distributions, there should 133d2343cb8SIngo Molnar be no measurable impact on performance. 1347b419f47SPeter Zijlstra 1359edeaea1SPeter Zijlstra 136