[RFC PATCH 30/86] Revert "preempt: Introduce CONFIG_PREEMPT_DYNAMIC"

From: Ankur Arora
Date: Tue Nov 07 2023 - 17:03:37 EST


This reverts commit 6ef869e0647439af0fc28dde162d33320d4e1dd7.

Also remove the CONFIG_PREEMPT_DYNAMIC guarded inclusion of
linux/entry-common.h which seems to have been missed somewhere.

Signed-off-by: Ankur Arora <ankur.a.arora@xxxxxxxxxx>
---
.../admin-guide/kernel-parameters.txt | 7 -------
arch/Kconfig | 9 ---------
arch/x86/Kconfig | 1 -
kernel/Kconfig.preempt | 19 -------------------
kernel/sched/core.c | 6 ------
5 files changed, 42 deletions(-)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 0a1731a0f0ef..93b60558a78f 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -4577,13 +4577,6 @@
Format: {"off"}
Disable Hardware Transactional Memory

- preempt= [KNL]
- Select preemption mode if you have CONFIG_PREEMPT_DYNAMIC
- none - Limited to cond_resched() calls
- voluntary - Limited to cond_resched() and might_sleep() calls
- full - Any section that isn't explicitly preempt disabled
- can be preempted anytime.
-
print-fatal-signals=
[KNL] debug: print fatal signals

diff --git a/arch/Kconfig b/arch/Kconfig
index afe6785fd3e2..05ce60036ecc 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -1393,15 +1393,6 @@ config HAVE_STATIC_CALL_INLINE
depends on HAVE_STATIC_CALL
select OBJTOOL

-config HAVE_PREEMPT_DYNAMIC
- bool
- depends on HAVE_STATIC_CALL
- depends on GENERIC_ENTRY
- help
- Select this if the architecture support boot time preempt setting
- on top of static calls. It is strongly advised to support inline
- static call to avoid any overhead.
-
config ARCH_WANT_LD_ORPHAN_WARN
bool
help
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index ec71c232af32..76e418bf469d 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -270,7 +270,6 @@ config X86
select HAVE_STACK_VALIDATION if HAVE_OBJTOOL
select HAVE_STATIC_CALL
select HAVE_STATIC_CALL_INLINE if HAVE_OBJTOOL
- select HAVE_PREEMPT_DYNAMIC
select HAVE_RSEQ
select HAVE_RUST if X86_64
select HAVE_SYSCALL_TRACEPOINTS
diff --git a/kernel/Kconfig.preempt b/kernel/Kconfig.preempt
index 5876e30c5740..715e7aebb9d8 100644
--- a/kernel/Kconfig.preempt
+++ b/kernel/Kconfig.preempt
@@ -40,7 +40,6 @@ config PREEMPT
depends on !ARCH_NO_PREEMPT
select PREEMPTION
select UNINLINE_SPIN_UNLOCK if !ARCH_INLINE_SPIN_UNLOCK
- select PREEMPT_DYNAMIC if HAVE_PREEMPT_DYNAMIC
help
This option reduces the latency of the kernel by making
all kernel code (that is not executing in a critical section)
@@ -82,24 +81,6 @@ config PREEMPTION
bool
select PREEMPT_COUNT

-config PREEMPT_DYNAMIC
- bool
- help
- This option allows to define the preemption model on the kernel
- command line parameter and thus override the default preemption
- model defined during compile time.
-
- The feature is primarily interesting for Linux distributions which
- provide a pre-built kernel binary to reduce the number of kernel
- flavors they offer while still offering different usecases.
-
- The runtime overhead is negligible with HAVE_STATIC_CALL_INLINE enabled
- but if runtime patching is not available for the specific architecture
- then the potential overhead should be considered.
-
- Interesting if you want the same pre-built kernel should be used for
- both Server and Desktop workloads.
-
config SCHED_CORE
bool "Core Scheduling for SMT"
depends on SCHED_SMT
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 5a0bf43975d4..e30007c11722 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -65,12 +65,6 @@
#include <linux/wait_api.h>
#include <linux/workqueue_api.h>

-#ifdef CONFIG_PREEMPT_DYNAMIC
-# ifdef CONFIG_GENERIC_ENTRY
-# include <linux/entry-common.h>
-# endif
-#endif
-
#include <uapi/linux/sched/types.h>

#include <asm/irq_regs.h>
--
2.31.1