Back to home page

OSCL-LXR

 
 

    


0001 # SPDX-License-Identifier: GPL-2.0-only
0002 
0003 config PREEMPT_NONE_BUILD
0004         bool
0005 
0006 config PREEMPT_VOLUNTARY_BUILD
0007         bool
0008 
0009 config PREEMPT_BUILD
0010         bool
0011         select PREEMPTION
0012         select UNINLINE_SPIN_UNLOCK if !ARCH_INLINE_SPIN_UNLOCK
0013 
0014 choice
0015         prompt "Preemption Model"
0016         default PREEMPT_NONE
0017 
0018 config PREEMPT_NONE
0019         bool "No Forced Preemption (Server)"
0020         select PREEMPT_NONE_BUILD if !PREEMPT_DYNAMIC
0021         help
0022           This is the traditional Linux preemption model, geared towards
0023           throughput. It will still provide good latencies most of the
0024           time, but there are no guarantees and occasional longer delays
0025           are possible.
0026 
0027           Select this option if you are building a kernel for a server or
0028           scientific/computation system, or if you want to maximize the
0029           raw processing power of the kernel, irrespective of scheduling
0030           latencies.
0031 
0032 config PREEMPT_VOLUNTARY
0033         bool "Voluntary Kernel Preemption (Desktop)"
0034         depends on !ARCH_NO_PREEMPT
0035         select PREEMPT_VOLUNTARY_BUILD if !PREEMPT_DYNAMIC
0036         help
0037           This option reduces the latency of the kernel by adding more
0038           "explicit preemption points" to the kernel code. These new
0039           preemption points have been selected to reduce the maximum
0040           latency of rescheduling, providing faster application reactions,
0041           at the cost of slightly lower throughput.
0042 
0043           This allows reaction to interactive events by allowing a
0044           low priority process to voluntarily preempt itself even if it
0045           is in kernel mode executing a system call. This allows
0046           applications to run more 'smoothly' even when the system is
0047           under load.
0048 
0049           Select this if you are building a kernel for a desktop system.
0050 
0051 config PREEMPT
0052         bool "Preemptible Kernel (Low-Latency Desktop)"
0053         depends on !ARCH_NO_PREEMPT
0054         select PREEMPT_BUILD
0055         help
0056           This option reduces the latency of the kernel by making
0057           all kernel code (that is not executing in a critical section)
0058           preemptible.  This allows reaction to interactive events by
0059           permitting a low priority process to be preempted involuntarily
0060           even if it is in kernel mode executing a system call and would
0061           otherwise not be about to reach a natural preemption point.
0062           This allows applications to run more 'smoothly' even when the
0063           system is under load, at the cost of slightly lower throughput
0064           and a slight runtime overhead to kernel code.
0065 
0066           Select this if you are building a kernel for a desktop or
0067           embedded system with latency requirements in the milliseconds
0068           range.
0069 
0070 config PREEMPT_RT
0071         bool "Fully Preemptible Kernel (Real-Time)"
0072         depends on EXPERT && ARCH_SUPPORTS_RT
0073         select PREEMPTION
0074         help
0075           This option turns the kernel into a real-time kernel by replacing
0076           various locking primitives (spinlocks, rwlocks, etc.) with
0077           preemptible priority-inheritance aware variants, enforcing
0078           interrupt threading and introducing mechanisms to break up long
0079           non-preemptible sections. This makes the kernel, except for very
0080           low level and critical code paths (entry code, scheduler, low
0081           level interrupt handling) fully preemptible and brings most
0082           execution contexts under scheduler control.
0083 
0084           Select this if you are building a kernel for systems which
0085           require real-time guarantees.
0086 
0087 endchoice
0088 
0089 config PREEMPT_COUNT
0090        bool
0091 
0092 config PREEMPTION
0093        bool
0094        select PREEMPT_COUNT
0095 
0096 config PREEMPT_DYNAMIC
0097         bool "Preemption behaviour defined on boot"
0098         depends on HAVE_PREEMPT_DYNAMIC && !PREEMPT_RT
0099         select JUMP_LABEL if HAVE_PREEMPT_DYNAMIC_KEY
0100         select PREEMPT_BUILD
0101         default y if HAVE_PREEMPT_DYNAMIC_CALL
0102         help
0103           This option allows to define the preemption model on the kernel
0104           command line parameter and thus override the default preemption
0105           model defined during compile time.
0106 
0107           The feature is primarily interesting for Linux distributions which
0108           provide a pre-built kernel binary to reduce the number of kernel
0109           flavors they offer while still offering different usecases.
0110 
0111           The runtime overhead is negligible with HAVE_STATIC_CALL_INLINE enabled
0112           but if runtime patching is not available for the specific architecture
0113           then the potential overhead should be considered.
0114 
0115           Interesting if you want the same pre-built kernel should be used for
0116           both Server and Desktop workloads.
0117 
0118 config SCHED_CORE
0119         bool "Core Scheduling for SMT"
0120         depends on SCHED_SMT
0121         help
0122           This option permits Core Scheduling, a means of coordinated task
0123           selection across SMT siblings. When enabled -- see
0124           prctl(PR_SCHED_CORE) -- task selection ensures that all SMT siblings
0125           will execute a task from the same 'core group', forcing idle when no
0126           matching task is found.
0127 
0128           Use of this feature includes:
0129            - mitigation of some (not all) SMT side channels;
0130            - limiting SMT interference to improve determinism and/or performance.
0131 
0132           SCHED_CORE is default disabled. When it is enabled and unused,
0133           which is the likely usage by Linux distributions, there should
0134           be no measurable impact on performance.
0135 
0136