mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* sched: Clarify PREEMPT is full preemption model
@ 2025-01-15  9:54 余华兵
  2025-01-16  8:37 ` Shrikanth Hegde
  0 siblings, 1 reply; 2+ messages in thread
From: 余华兵 @ 2025-01-15  9:54 UTC (permalink / raw)
  To: mingo, peterz; +Cc: linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 930 bytes --]

The configuration file "kernel/Kconfig. preempt" says that PREEMPT_RT is 
fully preemptible, but from the function preempt_model_full() it can be 
seen that PREEMPT is full preemption model.
--------------------------
kernel/Kconfig.preempt
config PREEMPT
        bool "Preemptible Kernel (Low-Latency Desktop)"

config PREEMPT_RT
        bool "Fully Preemptible Kernel (Real-Time)"

include/linux/preempt.h
static inline bool preempt_model_full(void)
{
        return IS_ENABLED(CONFIG_PREEMPT);
}
--------------------------

I suggest that the configuration file "kernel/Kconfig. preempt" should be 
consistent with the function preempt_model_full(). Modify the file 
"kernel/Kconfig.preempt" as follows.
------------------
config PREEMPT
        bool "Fully Preemptible Kernel (Low-Latency Desktop)"

config PREEMPT_RT
        bool "Real-time Kernel"
------------------

[-- Attachment #1.2: Type: text/html, Size: 1091 bytes --]

[-- Attachment #2: Clarify-PREEMPT-is-full-preemption-model.patch --]
[-- Type: application/octet-stream, Size: 1895 bytes --]

From f49c37767b08181e30af40121d5a000b6e2b4ffa Mon Sep 17 00:00:00 2001
From: Yu Huabing <yhb@ruijie.com.cn>
Date: Wed, 15 Jan 2025 16:15:25 +0800
Subject: [PATCH] sched: Clarify PREEMPT is full preemption model

The configuration file "kernel/Kconfig. preempt" says that PREEMPT_RT is 
fully preemptible, but from the function preempt_model_full() it can be 
seen that PREEMPT is full preemption model.
--------------------------
kernel/Kconfig.preempt
config PREEMPT
	bool "Preemptible Kernel (Low-Latency Desktop)"

config PREEMPT_RT
	bool "Fully Preemptible Kernel (Real-Time)"

include/linux/preempt.h
static inline bool preempt_model_full(void)
{
	return IS_ENABLED(CONFIG_PREEMPT);
}
--------------------------

I suggest that the configuration file "kernel/Kconfig. preempt" should be 
consistent with the function preempt_model_full(). Modify the file 
"kernel/Kconfig.preempt" as follows.
------------------
config PREEMPT
	bool "Fully Preemptible Kernel (Low-Latency Desktop)"

config PREEMPT_RT
	bool "Real-time Kernel"
------------------

Signed-off-by: Yu Huabing <yhb@ruijie.com.cn>
---
 kernel/Kconfig.preempt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/Kconfig.preempt b/kernel/Kconfig.preempt
index 54ea59ff8fbe..595e0c584958 100644
--- a/kernel/Kconfig.preempt
+++ b/kernel/Kconfig.preempt
@@ -54,7 +54,7 @@ config PREEMPT_VOLUNTARY
 	  Select this if you are building a kernel for a desktop system.
 
 config PREEMPT
-	bool "Preemptible Kernel (Low-Latency Desktop)"
+	bool "Fully Preemptible Kernel (Low-Latency Desktop)"
 	depends on !ARCH_NO_PREEMPT
 	select PREEMPT_BUILD if !PREEMPT_DYNAMIC
 	help
@@ -87,7 +87,7 @@ config PREEMPT_LAZY
 endchoice
 
 config PREEMPT_RT
-	bool "Fully Preemptible Kernel (Real-Time)"
+	bool "Real-time Kernel"
 	depends on EXPERT && ARCH_SUPPORTS_RT && !COMPILE_TEST
 	select PREEMPTION
 	help
-- 
2.43.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: sched: Clarify PREEMPT is full preemption model
  2025-01-15  9:54 sched: Clarify PREEMPT is full preemption model 余华兵
@ 2025-01-16  8:37 ` Shrikanth Hegde
  0 siblings, 0 replies; 2+ messages in thread
From: Shrikanth Hegde @ 2025-01-16  8:37 UTC (permalink / raw)
  To: 余华兵; +Cc: linux-kernel, mingo, peterz


Please use plaintext for sending mail containing patches.
Not able to see the patch on my mail client.  Also the text is not formatted.

https://docs.kernel.org/process/submitting-patches.html#no-mime-no-links-no-compression-no-attachments-just-plain-text


On 1/15/25 15:24, 余华兵 wrote:
> The configuration file "kernel/Kconfig. preempt" says that PREEMPT_RT is 
> fully preemptible, but from the function preempt_model_full() it can be 
> seen that PREEMPT is full preemption model. -------------------------- 
> kernel/Kconfig.preempt config PREEMPT         bool "Preemptible Kernel 
> (Low-Latency Desktop)" config PREEMPT_RT         bool "Fully Preemptible 
> Kernel (Real-Time)" include/linux/preempt.h static inline bool 
> preempt_model_full(void) {         return IS_ENABLED(CONFIG_PREEMPT); } 
> -------------------------- 

On Preempt_RT kernel, the spinlocks are sleeping locks and irqs can run as threaded.
So even those can be preempted if necessary. That is not true with preempt=full alone.

I suggest that the configuration file
> "kernel/Kconfig. preempt" should be consistent with the function 
> preempt_model_full(). Modify the file "kernel/Kconfig.preempt" as 
> follows. ------------------ config PREEMPT         bool "Fully 
> Preemptible Kernel (Low-Latency Desktop)" config PREEMPT_RT         bool 
> "Real-time Kernel" ------------------




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-01-16  8:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-15  9:54 sched: Clarify PREEMPT is full preemption model 余华兵
2025-01-16  8:37 ` Shrikanth Hegde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®