xref: /openbmc/linux/kernel/Kconfig.preempt (revision ec8f24b7faaf3d4799a7c3f4c1b87f6b02778ad1)
1 *ec8f24b7SThomas Gleixner# SPDX-License-Identifier: GPL-2.0-only
2 cc19ca86SIngo Molnar
3 f8cbd99bSIngo Molnarchoice
4 f8cbd99bSIngo Molnar	prompt "Preemption Model"
5 f8cbd99bSIngo Molnar	default PREEMPT_NONE
6 f8cbd99bSIngo Molnar
7 f8cbd99bSIngo Molnarconfig PREEMPT_NONE
8 f8cbd99bSIngo Molnar	bool "No Forced Preemption (Server)"
9 cc19ca86SIngo Molnar	help
10 f8cbd99bSIngo Molnar	  This is the traditional Linux preemption model, geared towards
11 f8cbd99bSIngo Molnar	  throughput. It will still provide good latencies most of the
12 f8cbd99bSIngo Molnar	  time, but there are no guarantees and occasional longer delays
13 f8cbd99bSIngo Molnar	  are possible.
14 f8cbd99bSIngo Molnar
15 f8cbd99bSIngo Molnar	  Select this option if you are building a kernel for a server or
16 f8cbd99bSIngo Molnar	  scientific/computation system, or if you want to maximize the
17 f8cbd99bSIngo Molnar	  raw processing power of the kernel, irrespective of scheduling
18 f8cbd99bSIngo Molnar	  latencies.
19 f8cbd99bSIngo Molnar
20 f8cbd99bSIngo Molnarconfig PREEMPT_VOLUNTARY
21 f8cbd99bSIngo Molnar	bool "Voluntary Kernel Preemption (Desktop)"
22 87a4c375SChristoph Hellwig	depends on !ARCH_NO_PREEMPT
23 f8cbd99bSIngo Molnar	help
24 f8cbd99bSIngo Molnar	  This option reduces the latency of the kernel by adding more
25 f8cbd99bSIngo Molnar	  "explicit preemption points" to the kernel code. These new
26 f8cbd99bSIngo Molnar	  preemption points have been selected to reduce the maximum
27 f8cbd99bSIngo Molnar	  latency of rescheduling, providing faster application reactions,
28 3dde6ad8SDavid Sterba	  at the cost of slightly lower throughput.
29 f8cbd99bSIngo Molnar
30 f8cbd99bSIngo Molnar	  This allows reaction to interactive events by allowing a
31 f8cbd99bSIngo Molnar	  low priority process to voluntarily preempt itself even if it
32 f8cbd99bSIngo Molnar	  is in kernel mode executing a system call. This allows
33 f8cbd99bSIngo Molnar	  applications to run more 'smoothly' even when the system is
34 cc19ca86SIngo Molnar	  under load.
35 cc19ca86SIngo Molnar
36 f8cbd99bSIngo Molnar	  Select this if you are building a kernel for a desktop system.
37 f8cbd99bSIngo Molnar
38 f8cbd99bSIngo Molnarconfig PREEMPT
39 f8cbd99bSIngo Molnar	bool "Preemptible Kernel (Low-Latency Desktop)"
40 87a4c375SChristoph Hellwig	depends on !ARCH_NO_PREEMPT
41 bdd4e85dSFrederic Weisbecker	select PREEMPT_COUNT
42 e335e3ebSRaghavendra K T	select UNINLINE_SPIN_UNLOCK if !ARCH_INLINE_SPIN_UNLOCK
43 f8cbd99bSIngo Molnar	help
44 f8cbd99bSIngo Molnar	  This option reduces the latency of the kernel by making
45 f8cbd99bSIngo Molnar	  all kernel code (that is not executing in a critical section)
46 f8cbd99bSIngo Molnar	  preemptible.  This allows reaction to interactive events by
47 f8cbd99bSIngo Molnar	  permitting a low priority process to be preempted involuntarily
48 f8cbd99bSIngo Molnar	  even if it is in kernel mode executing a system call and would
49 f8cbd99bSIngo Molnar	  otherwise not be about to reach a natural preemption point.
50 f8cbd99bSIngo Molnar	  This allows applications to run more 'smoothly' even when the
51 3dde6ad8SDavid Sterba	  system is under load, at the cost of slightly lower throughput
52 f8cbd99bSIngo Molnar	  and a slight runtime overhead to kernel code.
53 f8cbd99bSIngo Molnar
54 f8cbd99bSIngo Molnar	  Select this if you are building a kernel for a desktop or
55 f8cbd99bSIngo Molnar	  embedded system with latency requirements in the milliseconds
56 f8cbd99bSIngo Molnar	  range.
57 f8cbd99bSIngo Molnar
58 f8cbd99bSIngo Molnarendchoice
59 cc19ca86SIngo Molnar
60 bdd4e85dSFrederic Weisbeckerconfig PREEMPT_COUNT
61 bdd4e85dSFrederic Weisbecker       bool
62