Re: sched: Clarify PREEMPT is full preemption model

From: Shrikanth Hegde
Date: Thu Jan 16 2025 - 03:38:22 EST



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" ------------------