Kconfig.preempt 4.8 KB

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