Thomas Gleixner | ec8f24b | 2019-05-19 13:07:45 +0100 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0-only |
Ingo Molnar | cc19ca8 | 2005-06-25 14:57:36 -0700 | [diff] [blame] | 2 | |
Ingo Molnar | f8cbd99 | 2005-06-25 14:57:39 -0700 | [diff] [blame] | 3 | choice |
| 4 | prompt "Preemption Model" |
| 5 | default PREEMPT_NONE |
| 6 | |
| 7 | config PREEMPT_NONE |
| 8 | bool "No Forced Preemption (Server)" |
Ingo Molnar | cc19ca8 | 2005-06-25 14:57:36 -0700 | [diff] [blame] | 9 | help |
Ingo Molnar | f8cbd99 | 2005-06-25 14:57:39 -0700 | [diff] [blame] | 10 | This is the traditional Linux preemption model, geared towards |
| 11 | throughput. It will still provide good latencies most of the |
| 12 | time, but there are no guarantees and occasional longer delays |
| 13 | are possible. |
| 14 | |
| 15 | Select this option if you are building a kernel for a server or |
| 16 | scientific/computation system, or if you want to maximize the |
| 17 | raw processing power of the kernel, irrespective of scheduling |
| 18 | latencies. |
| 19 | |
| 20 | config PREEMPT_VOLUNTARY |
| 21 | bool "Voluntary Kernel Preemption (Desktop)" |
Christoph Hellwig | 87a4c37 | 2018-07-31 13:39:32 +0200 | [diff] [blame] | 22 | depends on !ARCH_NO_PREEMPT |
Ingo Molnar | f8cbd99 | 2005-06-25 14:57:39 -0700 | [diff] [blame] | 23 | help |
| 24 | This option reduces the latency of the kernel by adding more |
| 25 | "explicit preemption points" to the kernel code. These new |
| 26 | preemption points have been selected to reduce the maximum |
| 27 | latency of rescheduling, providing faster application reactions, |
David Sterba | 3dde6ad | 2007-05-09 07:12:20 +0200 | [diff] [blame] | 28 | at the cost of slightly lower throughput. |
Ingo Molnar | f8cbd99 | 2005-06-25 14:57:39 -0700 | [diff] [blame] | 29 | |
| 30 | This allows reaction to interactive events by allowing a |
| 31 | low priority process to voluntarily preempt itself even if it |
| 32 | is in kernel mode executing a system call. This allows |
| 33 | applications to run more 'smoothly' even when the system is |
Ingo Molnar | cc19ca8 | 2005-06-25 14:57:36 -0700 | [diff] [blame] | 34 | under load. |
| 35 | |
Ingo Molnar | f8cbd99 | 2005-06-25 14:57:39 -0700 | [diff] [blame] | 36 | Select this if you are building a kernel for a desktop system. |
| 37 | |
Thomas Gleixner | b8d3349 | 2019-07-22 17:59:19 +0200 | [diff] [blame] | 38 | config PREEMPT |
Ingo Molnar | f8cbd99 | 2005-06-25 14:57:39 -0700 | [diff] [blame] | 39 | bool "Preemptible Kernel (Low-Latency Desktop)" |
Christoph Hellwig | 87a4c37 | 2018-07-31 13:39:32 +0200 | [diff] [blame] | 40 | depends on !ARCH_NO_PREEMPT |
Thomas Gleixner | b8d3349 | 2019-07-22 17:59:19 +0200 | [diff] [blame] | 41 | select PREEMPTION |
Raghavendra K T | e335e3e | 2012-03-22 15:25:08 +0530 | [diff] [blame] | 42 | select UNINLINE_SPIN_UNLOCK if !ARCH_INLINE_SPIN_UNLOCK |
Michal Hocko | 6ef869e | 2021-01-18 15:12:19 +0100 | [diff] [blame] | 43 | select PREEMPT_DYNAMIC if HAVE_PREEMPT_DYNAMIC |
Ingo Molnar | f8cbd99 | 2005-06-25 14:57:39 -0700 | [diff] [blame] | 44 | 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 Sterba | 3dde6ad | 2007-05-09 07:12:20 +0200 | [diff] [blame] | 52 | system is under load, at the cost of slightly lower throughput |
Ingo Molnar | f8cbd99 | 2005-06-25 14:57:39 -0700 | [diff] [blame] | 53 | 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 Gleixner | a50a3f4 | 2019-07-17 22:01:49 +0200 | [diff] [blame] | 59 | config PREEMPT_RT |
| 60 | bool "Fully Preemptible Kernel (Real-Time)" |
| 61 | depends on EXPERT && ARCH_SUPPORTS_RT |
Thomas Gleixner | b8d3349 | 2019-07-22 17:59:19 +0200 | [diff] [blame] | 62 | select PREEMPTION |
Thomas Gleixner | a50a3f4 | 2019-07-17 22:01:49 +0200 | [diff] [blame] | 63 | 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) | d61ca3c | 2019-10-25 16:02:07 -0700 | [diff] [blame] | 69 | low level and critical code paths (entry code, scheduler, low |
Thomas Gleixner | a50a3f4 | 2019-07-17 22:01:49 +0200 | [diff] [blame] | 70 | 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 Molnar | f8cbd99 | 2005-06-25 14:57:39 -0700 | [diff] [blame] | 76 | endchoice |
Ingo Molnar | cc19ca8 | 2005-06-25 14:57:36 -0700 | [diff] [blame] | 77 | |
Frederic Weisbecker | bdd4e85 | 2011-06-08 01:13:27 +0200 | [diff] [blame] | 78 | config PREEMPT_COUNT |
Masahiro Yamada | 7236793 | 2018-12-11 20:00:51 +0900 | [diff] [blame] | 79 | bool |
Thomas Gleixner | a50a3f4 | 2019-07-17 22:01:49 +0200 | [diff] [blame] | 80 | |
Thomas Gleixner | b8d3349 | 2019-07-22 17:59:19 +0200 | [diff] [blame] | 81 | config PREEMPTION |
Thomas Gleixner | a50a3f4 | 2019-07-17 22:01:49 +0200 | [diff] [blame] | 82 | bool |
| 83 | select PREEMPT_COUNT |
Michal Hocko | 6ef869e | 2021-01-18 15:12:19 +0100 | [diff] [blame] | 84 | |
| 85 | config PREEMPT_DYNAMIC |
| 86 | bool |
| 87 | help |
| 88 | This option allows to define the preemption model on the kernel |
| 89 | command line parameter and thus override the default preemption |
| 90 | model defined during compile time. |
| 91 | |
| 92 | The feature is primarily interesting for Linux distributions which |
| 93 | provide a pre-built kernel binary to reduce the number of kernel |
| 94 | flavors they offer while still offering different usecases. |
| 95 | |
| 96 | The runtime overhead is negligible with HAVE_STATIC_CALL_INLINE enabled |
| 97 | but if runtime patching is not available for the specific architecture |
| 98 | then the potential overhead should be considered. |
| 99 | |
| 100 | Interesting if you want the same pre-built kernel should be used for |
| 101 | both Server and Desktop workloads. |
Peter Zijlstra | 9edeaea | 2020-11-17 18:19:34 -0500 | [diff] [blame] | 102 | |
| 103 | config SCHED_CORE |
| 104 | bool "Core Scheduling for SMT" |
| 105 | default y |
| 106 | depends on SCHED_SMT |
Peter Zijlstra | 7b419f4 | 2021-05-25 08:53:28 +0200 | [diff] [blame^] | 107 | help |
| 108 | This option permits Core Scheduling, a means of coordinated task |
| 109 | selection across SMT siblings. When enabled -- see |
| 110 | prctl(PR_SCHED_CORE) -- task selection ensures that all SMT siblings |
| 111 | will execute a task from the same 'core group', forcing idle when no |
| 112 | matching task is found. |
| 113 | |
| 114 | Use of this feature includes: |
| 115 | - mitigation of some (not all) SMT side channels; |
| 116 | - limiting SMT interference to improve determinism and/or performance. |
| 117 | |
| 118 | SCHED_CORE is default enabled when SCHED_SMT is enabled -- when |
| 119 | unused there should be no impact on performance. |
| 120 | |
Peter Zijlstra | 9edeaea | 2020-11-17 18:19:34 -0500 | [diff] [blame] | 121 | |