Skip to contentSkip to conversation

Kconfig: Introduce CONFIG_PREEMPT_RT

PATCH Superseded Thomas Gleixner 16 participants 20 messages Jul 15, 2019 – Jul 18, 2019

lore
Share & tools
lore
#0 lore raw

cover Kconfig: Introduce CONFIG_PREEMPT_RT

Linus,

please consider to apply the following patch, which introduces the Kconfig symbol CONFIG_PREEMPT_RT.

Rationale:

The real-time preemption patch set exists for almost 15 years now and while the vast majority of infrastructure and enhancements have found their way into the mainline kernel, the final integration of RT is still missing.

Over the course of the last few years, we have worked on reducing the intrusivenness of the RT patches by refactoring kernel infrastructure to be more real-time friendly. Almost all of these changes were benefitial to the mainline kernel on their own, so there was no objection to integrate them.

Though except for the still ongoing printk refactoring, the remaining changes which are required to make RT a first class mainline citizen are not longer arguable as immediately beneficial for the mainline kernel. Most of them are either reordering code flows or adding RT specific functionality. But this now has hit a wall and turned into a classic hen and egg problem:

Maintainers are rightfully wary vs. these changes as they make only sense if the final integration of RT into the mainline kernel takes place.

Adding CONFIG_PREEMPT_RT aims to solve this as a clear sign that RT will be fully integrated into the mainline kernel. The final integration of the missing bits and pieces will be of course done with the same careful approach as we have used in the past.

While I'm aware that you are not entirely enthusiastic about that, I think that RT should receive the same treatment as any other widely used out of tree functionality, which we have accepted into mainline over the years.

RT has become the de-facto standard real-time enhancement and is shipped by enterprise, embedded and community distros. It's in use throughout a wide range of industries: telecommunications, industrial automation, professional audio, medical devices, data acquisition, automotive - just to name a few major use cases.

RT development is backed by a Linuxfoundation project which is supported by major stakeholders of this technology. The funding will continue over the actual inclusion into mainline to make sure that the functionality is neither introducing regressions, regressing itself, nor becomes subject to bitrot. There is also a lifely user community around RT as well, so contrary to the grim situation 5 years ago, it's a healthy project.

As RT is still a good vehicle to exercise rarely used code paths and to detect hard to trigger issues, you could at least view it as a QA tool if nothing else.

The current state of the RT patches against 5.2 is:

   365 files changed, 9396 insertions(+), 3209 deletions(-)

When the already queued changes, agreed on changes and the ongoing printk work is taken out then the diffstat is reduced to:

   311 files changed, 6567 insertions(+), 1352 deletions(-)

Out of the 6567 insertions about 4000 lines are the self contained RT infrastructure (lock substitutions, scheduler addons, etc.).

The remaining bits and pieces are smallish changes to places which need to be slightly modified to cope with the RT semantics.

The current full RT set can be found here:

git://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git linux-5.2.y-rt

Note that aside of the printk changes (which are under flux due to the ongoing review/design discussions) also a large part of the rest is not the final state as these changes still need to be discussed with the relevant maintainers and we are still working hard on refinining them and reducing the impact. So while the big picture is probably good reflected, please take the details with a grain of salt.

Thanks,

Thomas

#1 lore raw

PATCH 1/1 Kconfig: Introduce CONFIG_PREEMPT_RT

Add a new entry to the preemption menu which enables the real-time support for the kernel. The choice is only enabled when an architecture supports it.

It selects PREEMPT as the RT features depend on it. To achieve that the existing PREEMPT choice is renamed to PREEMPT_LL which select PREEMPT as well.

No functional change.

---
 arch/Kconfig           |    3 +++
 kernel/Kconfig.preempt |   25 +++++++++++++++++++++++--
 2 files changed, 26 insertions(+), 2 deletions(-)
arch/Kconfig +3 -0
@@ -809,6 +809,9 @@ config ARCH_NO_COHERENT_DMA_MMAP
 config ARCH_NO_PREEMPT
 	bool
 
+config ARCH_SUPPORTS_RT
+	bool
+
 config CPU_NO_EFFICIENT_FFS
 	def_bool n
 
kernel/Kconfig.preempt +23 -2
@@ -35,10 +35,10 @@ config PREEMPT_VOLUNTARY
 
 	  Select this if you are building a kernel for a desktop system.
 
-config PREEMPT
+config PREEMPT_LL
 	bool "Preemptible Kernel (Low-Latency Desktop)"
 	depends on !ARCH_NO_PREEMPT
-	select PREEMPT_COUNT
+	select PREEMPT
 	select UNINLINE_SPIN_UNLOCK if !ARCH_INLINE_SPIN_UNLOCK
 	help
 	  This option reduces the latency of the kernel by making
@@ -55,7 +55,28 @@ config PREEMPT
 	  embedded system with latency requirements in the milliseconds
 	  range.
 
+config PREEMPT_RT
+	bool "Fully Preemptible Kernel (Real-Time)"
+	depends on EXPERT && ARCH_SUPPORTS_RT
+	select PREEMPT
+	help
+	  This option turns the kernel into a real-time kernel by replacing
+	  various locking primitives (spinlocks, rwlocks, etc) with
+	  preemptible priority-inheritance aware variants, enforcing
+	  interrupt threading and introducing mechanisms to break up long
+	  non-preemtible sections. This makes the kernel, except for very
+	  low level and critical code pathes (entry code, scheduler, low
+	  level interrupt handling) fully preemtible and brings most
+	  execution contexts under scheduler control.
+
+	  Select this if you are building a kernel for systems which
+	  require real-time guarantees.
+
 endchoice
 
 config PREEMPT_COUNT
        bool
+
+config PREEMPT
+       bool
+       select PREEMPT_COUNT
#2 lore raw
Quoted 47 lines · Thomas Gleixner

Add a new entry to the preemption menu which enables the real-time support for the kernel. The choice is only enabled when an architecture supports it.

It selects PREEMPT as the RT features depend on it. To achieve that the existing PREEMPT choice is renamed to PREEMPT_LL which select PREEMPT as well.

No functional change.

---
 arch/Kconfig           |    3 +++
 kernel/Kconfig.preempt |   25 +++++++++++++++++++++++--
 2 files changed, 26 insertions(+), 2 deletions(-)
arch/Kconfig +3 -0
@@ -809,6 +809,9 @@ config ARCH_NO_COHERENT_DMA_MMAP
 config ARCH_NO_PREEMPT
 	bool
 
+config ARCH_SUPPORTS_RT
+	bool
+
 config CPU_NO_EFFICIENT_FFS
 	def_bool n
 
kernel/Kconfig.preempt +2 -2
@@ -35,10 +35,10 @@ config PREEMPT_VOLUNTARY
 
 	  Select this if you are building a kernel for a desktop system.
 
-config PREEMPT
+config PREEMPT_LL
 	bool "Preemptible Kernel (Low-Latency Desktop)"
 	depends on !ARCH_NO_PREEMPT
-	select PREEMPT_COUNT
+	select PREEMPT
 	select UNINLINE_SPIN_UNLOCK if !ARCH_INLINE_SPIN_UNLOCK
 	help
 	  This option reduces the latency of the kernel by making
@@ -55,7 +55,28 @@ config PREEMPT
 	  embedded system with latency requirements in the milliseconds
 	  range.
 

kernel/Kconfig.preempt config PREEMPT · line 67

Quoted 10 lines
kernel/Kconfig.preempt +10 -0
+config PREEMPT_RT
+	bool "Fully Preemptible Kernel (Real-Time)"
+	depends on EXPERT && ARCH_SUPPORTS_RT
+	select PREEMPT
+	help
+	  This option turns the kernel into a real-time kernel by replacing
+	  various locking primitives (spinlocks, rwlocks, etc) with
+	  preemptible priority-inheritance aware variants, enforcing
+	  interrupt threading and introducing mechanisms to break up long
+	  non-preemtible sections. This makes the kernel, except for very

Here is a typo:

s/non-preemtible/non-preemptible/

Nice to see this feature finally getting very close to being merged :)

Lukas

Quoted 18 lines
kernel/Kconfig.preempt +11 -0
+	  low level and critical code pathes (entry code, scheduler, low
+	  level interrupt handling) fully preemtible and brings most
+	  execution contexts under scheduler control.
+
+	  Select this if you are building a kernel for systems which
+	  require real-time guarantees.
+
 endchoice
 
 config PREEMPT_COUNT
        bool
+
+config PREEMPT
+       bool
+       select PREEMPT_COUNT
Acked-by on v1 1/1
#3 lore raw
In reply to Thomas Gleixner
Quoted 11 lines · Thomas Gleixner

Add a new entry to the preemption menu which enables the real-time support for the kernel. The choice is only enabled when an architecture supports it.

It selects PREEMPT as the RT features depend on it. To achieve that the existing PREEMPT choice is renamed to PREEMPT_LL which select PREEMPT as well.

No functional change.

This would make it easier to get some of the remaining RCU patches from -rt to mainline, for example, the rcutorture changes proposed recently.

Quoted 63 lines
---
 arch/Kconfig           |    3 +++
 kernel/Kconfig.preempt |   25 +++++++++++++++++++++++--
 2 files changed, 26 insertions(+), 2 deletions(-)
arch/Kconfig +3 -0
@@ -809,6 +809,9 @@ config ARCH_NO_COHERENT_DMA_MMAP
 config ARCH_NO_PREEMPT
 	bool
 
+config ARCH_SUPPORTS_RT
+	bool
+
 config CPU_NO_EFFICIENT_FFS
 	def_bool n
 
kernel/Kconfig.preempt +23 -2
@@ -35,10 +35,10 @@ config PREEMPT_VOLUNTARY
 
 	  Select this if you are building a kernel for a desktop system.
 
-config PREEMPT
+config PREEMPT_LL
 	bool "Preemptible Kernel (Low-Latency Desktop)"
 	depends on !ARCH_NO_PREEMPT
-	select PREEMPT_COUNT
+	select PREEMPT
 	select UNINLINE_SPIN_UNLOCK if !ARCH_INLINE_SPIN_UNLOCK
 	help
 	  This option reduces the latency of the kernel by making
@@ -55,7 +55,28 @@ config PREEMPT
 	  embedded system with latency requirements in the milliseconds
 	  range.
 
+config PREEMPT_RT
+	bool "Fully Preemptible Kernel (Real-Time)"
+	depends on EXPERT && ARCH_SUPPORTS_RT
+	select PREEMPT
+	help
+	  This option turns the kernel into a real-time kernel by replacing
+	  various locking primitives (spinlocks, rwlocks, etc) with
+	  preemptible priority-inheritance aware variants, enforcing
+	  interrupt threading and introducing mechanisms to break up long
+	  non-preemtible sections. This makes the kernel, except for very
+	  low level and critical code pathes (entry code, scheduler, low
+	  level interrupt handling) fully preemtible and brings most
+	  execution contexts under scheduler control.
+
+	  Select this if you are building a kernel for systems which
+	  require real-time guarantees.
+
 endchoice
 
 config PREEMPT_COUNT
        bool
+
+config PREEMPT
+       bool
+       select PREEMPT_COUNT
Acked-by on v1 1/1
#4 lore raw
In reply to Thomas Gleixner
Quoted 44 lines · On Mon, 15 Jul 2019 17:04:03 +0200 Thomas Gleixner <[email protected]> wrote:

Add a new entry to the preemption menu which enables the real-time support for the kernel. The choice is only enabled when an architecture supports it.

It selects PREEMPT as the RT features depend on it. To achieve that the existing PREEMPT choice is renamed to PREEMPT_LL which select PREEMPT as well.

No functional change.

---
 arch/Kconfig           |    3 +++
 kernel/Kconfig.preempt |   25 +++++++++++++++++++++++--
 2 files changed, 26 insertions(+), 2 deletions(-)
arch/Kconfig +3 -0
@@ -809,6 +809,9 @@ config ARCH_NO_COHERENT_DMA_MMAP
 config ARCH_NO_PREEMPT
 	bool
 
+config ARCH_SUPPORTS_RT
+	bool
+
 config CPU_NO_EFFICIENT_FFS
 	def_bool n
 
kernel/Kconfig.preempt +2 -2
@@ -35,10 +35,10 @@ config PREEMPT_VOLUNTARY
 
 	  Select this if you are building a kernel for a desktop system.
 
-config PREEMPT
+config PREEMPT_LL
 	bool "Preemptible Kernel (Low-Latency Desktop)"
 	depends on !ARCH_NO_PREEMPT
-	select PREEMPT_COUNT
+	select PREEMPT
 	select UNINLINE_SPIN_UNLOCK if !ARCH_INLINE_SPIN_UNLOCK
 	help
 	  This option reduces the latency of the kernel by making

kernel/Kconfig.preempt config PREEMPT · line 60

Quoted 6 lines
kernel/Kconfig.preempt +3 -0
@@ -55,7 +55,28 @@ config PREEMPT
 	  embedded system with latency requirements in the milliseconds
 	  range.
 
+config PREEMPT_RT
+	bool "Fully Preemptible Kernel (Real-Time)"
+	depends on EXPERT && ARCH_SUPPORTS_RT

I can't wait to see the CONFIG_ARCH_SUPPORTS_RT added!

-- Steve

Quoted 23 lines
kernel/Kconfig.preempt +18 -0
+	select PREEMPT
+	help
+	  This option turns the kernel into a real-time kernel by replacing
+	  various locking primitives (spinlocks, rwlocks, etc) with
+	  preemptible priority-inheritance aware variants, enforcing
+	  interrupt threading and introducing mechanisms to break up long
+	  non-preemtible sections. This makes the kernel, except for very
+	  low level and critical code pathes (entry code, scheduler, low
+	  level interrupt handling) fully preemtible and brings most
+	  execution contexts under scheduler control.
+
+	  Select this if you are building a kernel for systems which
+	  require real-time guarantees.
+
 endchoice
 
 config PREEMPT_COUNT
        bool
+
+config PREEMPT
+       bool
+       select PREEMPT_COUNT
Acked-by on v1 1/1
#5 lore raw
In reply to Thomas Gleixner
Quoted 11 lines · On Mon, 15 Jul 2019 17:04:03 +0200 Thomas Gleixner <[email protected]> wrote:

Add a new entry to the preemption menu which enables the real-time support for the kernel. The choice is only enabled when an architecture supports it.

It selects PREEMPT as the RT features depend on it. To achieve that the existing PREEMPT choice is renamed to PREEMPT_LL which select PREEMPT as well.

No functional change.

Excited to see this Thomas. Now I can start planning to build from a single tree rather than an RT tree off to the side of RHEL :)

Quoted 63 lines
---
 arch/Kconfig           |    3 +++
 kernel/Kconfig.preempt |   25 +++++++++++++++++++++++--
 2 files changed, 26 insertions(+), 2 deletions(-)
arch/Kconfig +3 -0
@@ -809,6 +809,9 @@ config ARCH_NO_COHERENT_DMA_MMAP
 config ARCH_NO_PREEMPT
 	bool
 
+config ARCH_SUPPORTS_RT
+	bool
+
 config CPU_NO_EFFICIENT_FFS
 	def_bool n
 
kernel/Kconfig.preempt +23 -2
@@ -35,10 +35,10 @@ config PREEMPT_VOLUNTARY
 
 	  Select this if you are building a kernel for a desktop system.
 
-config PREEMPT
+config PREEMPT_LL
 	bool "Preemptible Kernel (Low-Latency Desktop)"
 	depends on !ARCH_NO_PREEMPT
-	select PREEMPT_COUNT
+	select PREEMPT
 	select UNINLINE_SPIN_UNLOCK if !ARCH_INLINE_SPIN_UNLOCK
 	help
 	  This option reduces the latency of the kernel by making
@@ -55,7 +55,28 @@ config PREEMPT
 	  embedded system with latency requirements in the milliseconds
 	  range.
 
+config PREEMPT_RT
+	bool "Fully Preemptible Kernel (Real-Time)"
+	depends on EXPERT && ARCH_SUPPORTS_RT
+	select PREEMPT
+	help
+	  This option turns the kernel into a real-time kernel by replacing
+	  various locking primitives (spinlocks, rwlocks, etc) with
+	  preemptible priority-inheritance aware variants, enforcing
+	  interrupt threading and introducing mechanisms to break up long
+	  non-preemtible sections. This makes the kernel, except for very
+	  low level and critical code pathes (entry code, scheduler, low
+	  level interrupt handling) fully preemtible and brings most
+	  execution contexts under scheduler control.
+
+	  Select this if you are building a kernel for systems which
+	  require real-time guarantees.
+
 endchoice
 
 config PREEMPT_COUNT
        bool
+
+config PREEMPT
+       bool
+       select PREEMPT_COUNT
Signature · 2 lines
The United States Coast Guard
Ruining Natural Selection since 1790
#6 lore raw
Quoted 11 lines · Clark Williams
Quoted 8 lines · On Mon, 15 Jul 2019 17:04:03 +0200 Thomas Gleixner <[email protected]> wrote:

Add a new entry to the preemption menu which enables the real-time support for the kernel. The choice is only enabled when an architecture supports it.

It selects PREEMPT as the RT features depend on it. To achieve that the existing PREEMPT choice is renamed to PREEMPT_LL which select PREEMPT as well.

Quoted 8 lines
Quoted 3 lines

No functional change.

Excited to see this Thomas. Now I can start planning to build from a single tree rather than an RT tree off to the side of RHEL :)

yeah! We (Red Hat) are committed with maintaining and testing the PREEMPT RT mainstream in the long term. Including the development of more tests and formal verification for it!

Thanks!
-- Daniel

#7 lore raw
Quoted 10 lines · Daniel Bristot de Oliveira
Quoted 5 lines · Clark Williams

Excited to see this Thomas. Now I can start planning to build from a single tree rather than an RT tree off to the side of RHEL :)

yeah! We (Red Hat) are committed with maintaining and testing the PREEMPT RT mainstream in the long term. Including the development of more tests and formal verification for it!

AND MY AXE!!! (Suse)

Quoted 5 lines

Thanks!
-- Daniel

Acked-by on v1 1/1
#8 lore raw
In reply to Thomas Gleixner
Quoted 44 lines · Thomas Gleixner

Add a new entry to the preemption menu which enables the real-time support for the kernel. The choice is only enabled when an architecture supports it.

It selects PREEMPT as the RT features depend on it. To achieve that the existing PREEMPT choice is renamed to PREEMPT_LL which select PREEMPT as well.

No functional change.

---
 arch/Kconfig           |    3 +++
 kernel/Kconfig.preempt |   25 +++++++++++++++++++++++--
 2 files changed, 26 insertions(+), 2 deletions(-)
arch/Kconfig +3 -0
@@ -809,6 +809,9 @@ config ARCH_NO_COHERENT_DMA_MMAP
 config ARCH_NO_PREEMPT
 	bool
 
+config ARCH_SUPPORTS_RT
+	bool
+
 config CPU_NO_EFFICIENT_FFS
 	def_bool n
 
kernel/Kconfig.preempt +2 -2
@@ -35,10 +35,10 @@ config PREEMPT_VOLUNTARY
 
 	  Select this if you are building a kernel for a desktop system.
 
-config PREEMPT
+config PREEMPT_LL
 	bool "Preemptible Kernel (Low-Latency Desktop)"
 	depends on !ARCH_NO_PREEMPT
-	select PREEMPT_COUNT
+	select PREEMPT
 	select UNINLINE_SPIN_UNLOCK if !ARCH_INLINE_SPIN_UNLOCK
 	help
 	  This option reduces the latency of the kernel by making

kernel/Kconfig.preempt config PREEMPT · line 64

Quoted 10 lines
kernel/Kconfig.preempt +7 -0
@@ -55,7 +55,28 @@ config PREEMPT
 	  embedded system with latency requirements in the milliseconds
 	  range.
 
+config PREEMPT_RT
+	bool "Fully Preemptible Kernel (Real-Time)"
+	depends on EXPERT && ARCH_SUPPORTS_RT
+	select PREEMPT
+	help
+	  This option turns the kernel into a real-time kernel by replacing
+	  various locking primitives (spinlocks, rwlocks, etc) with

s/etc/etc.

kernel/Kconfig.preempt config PREEMPT · line 67

Quoted 3 lines
kernel/Kconfig.preempt +3 -0
+	  preemptible priority-inheritance aware variants, enforcing
+	  interrupt threading and introducing mechanisms to break up long
+	  non-preemtible sections. This makes the kernel, except for very

s/preemtible/preemptible

kernel/Kconfig.preempt config PREEMPT · line 69

Quoted 2 lines
kernel/Kconfig.preempt +2 -0
+	  low level and critical code pathes (entry code, scheduler, low
+	  level interrupt handling) fully preemtible and brings most

s/preemtible/preemptible

kernel/Kconfig.preempt config PREEMPT · line 73

Quoted 4 lines
kernel/Kconfig.preempt +4 -0
+	  execution contexts under scheduler control.
+
+	  Select this if you are building a kernel for systems which
+	  require real-time guarantees.

Nice to see this getting started! :-)

Thanks,

Ingo

Acked-by on v1 1/1
#9 lore raw
In reply to Thomas Gleixner
Quoted 11 lines · Thomas Gleixner

Add a new entry to the preemption menu which enables the real-time support for the kernel. The choice is only enabled when an architecture supports it.

It selects PREEMPT as the RT features depend on it. To achieve that the existing PREEMPT choice is renamed to PREEMPT_LL which select PREEMPT as well.

No functional change.

+1 from National Instruments. We have a vested interest in preempt_rt and we're committed in helping support, maintain, and test it. Glad to see this happening.

Thanks,
Gratian

Quoted 61 lines
---
 arch/Kconfig           |    3 +++
 kernel/Kconfig.preempt |   25 +++++++++++++++++++++++--
 2 files changed, 26 insertions(+), 2 deletions(-)
arch/Kconfig +3 -0
@@ -809,6 +809,9 @@ config ARCH_NO_COHERENT_DMA_MMAP
 config ARCH_NO_PREEMPT
 	bool
 
+config ARCH_SUPPORTS_RT
+	bool
+
 config CPU_NO_EFFICIENT_FFS
 	def_bool n
 
kernel/Kconfig.preempt +23 -2
@@ -35,10 +35,10 @@ config PREEMPT_VOLUNTARY
 
 	  Select this if you are building a kernel for a desktop system.
 
-config PREEMPT
+config PREEMPT_LL
 	bool "Preemptible Kernel (Low-Latency Desktop)"
 	depends on !ARCH_NO_PREEMPT
-	select PREEMPT_COUNT
+	select PREEMPT
 	select UNINLINE_SPIN_UNLOCK if !ARCH_INLINE_SPIN_UNLOCK
 	help
 	  This option reduces the latency of the kernel by making
@@ -55,7 +55,28 @@ config PREEMPT
 	  embedded system with latency requirements in the milliseconds
 	  range.
 
+config PREEMPT_RT
+	bool "Fully Preemptible Kernel (Real-Time)"
+	depends on EXPERT && ARCH_SUPPORTS_RT
+	select PREEMPT
+	help
+	  This option turns the kernel into a real-time kernel by replacing
+	  various locking primitives (spinlocks, rwlocks, etc) with
+	  preemptible priority-inheritance aware variants, enforcing
+	  interrupt threading and introducing mechanisms to break up long
+	  non-preemtible sections. This makes the kernel, except for very
+	  low level and critical code pathes (entry code, scheduler, low
+	  level interrupt handling) fully preemtible and brings most
+	  execution contexts under scheduler control.
+
+	  Select this if you are building a kernel for systems which
+	  require real-time guarantees.
+
 endchoice
 
 config PREEMPT_COUNT
        bool
+
+config PREEMPT
+       bool
+       select PREEMPT_COUNT
Acked-by on v1 1/1
#10 lore raw
In reply to Thomas Gleixner
Quoted 11 lines · Thomas Gleixner

Add a new entry to the preemption menu which enables the real-time support for the kernel. The choice is only enabled when an architecture supports it.

It selects PREEMPT as the RT features depend on it. To achieve that the existing PREEMPT choice is renamed to PREEMPT_LL which select PREEMPT as well.

No functional change.

Quoted 63 lines
---
 arch/Kconfig           |    3 +++
 kernel/Kconfig.preempt |   25 +++++++++++++++++++++++--
 2 files changed, 26 insertions(+), 2 deletions(-)
arch/Kconfig +3 -0
@@ -809,6 +809,9 @@ config ARCH_NO_COHERENT_DMA_MMAP
 config ARCH_NO_PREEMPT
 	bool
 
+config ARCH_SUPPORTS_RT
+	bool
+
 config CPU_NO_EFFICIENT_FFS
 	def_bool n
 
kernel/Kconfig.preempt +23 -2
@@ -35,10 +35,10 @@ config PREEMPT_VOLUNTARY
 
 	  Select this if you are building a kernel for a desktop system.
 
-config PREEMPT
+config PREEMPT_LL
 	bool "Preemptible Kernel (Low-Latency Desktop)"
 	depends on !ARCH_NO_PREEMPT
-	select PREEMPT_COUNT
+	select PREEMPT
 	select UNINLINE_SPIN_UNLOCK if !ARCH_INLINE_SPIN_UNLOCK
 	help
 	  This option reduces the latency of the kernel by making
@@ -55,7 +55,28 @@ config PREEMPT
 	  embedded system with latency requirements in the milliseconds
 	  range.
 
+config PREEMPT_RT
+	bool "Fully Preemptible Kernel (Real-Time)"
+	depends on EXPERT && ARCH_SUPPORTS_RT
+	select PREEMPT
+	help
+	  This option turns the kernel into a real-time kernel by replacing
+	  various locking primitives (spinlocks, rwlocks, etc) with
+	  preemptible priority-inheritance aware variants, enforcing
+	  interrupt threading and introducing mechanisms to break up long
+	  non-preemtible sections. This makes the kernel, except for very
+	  low level and critical code pathes (entry code, scheduler, low
+	  level interrupt handling) fully preemtible and brings most
+	  execution contexts under scheduler control.
+
+	  Select this if you are building a kernel for systems which
+	  require real-time guarantees.
+
 endchoice
 
 config PREEMPT_COUNT
        bool
+
+config PREEMPT
+       bool
+       select PREEMPT_COUNT
Acked-by on v1 1/1
#11 lore raw
In reply to Thomas Gleixner
Quoted 11 lines · Thomas Gleixner

Add a new entry to the preemption menu which enables the real-time support for the kernel. The choice is only enabled when an architecture supports it.

It selects PREEMPT as the RT features depend on it. To achieve that the existing PREEMPT choice is renamed to PREEMPT_LL which select PREEMPT as well.

No functional change.

	M.
Signature · 1 line
Jazz is not dead. It just smells funny...
Acked-by on v1 1/1
#12 lore raw
In reply to Thomas Gleixner

Hi,

Quoted 11 lines · Thomas Gleixner

Add a new entry to the preemption menu which enables the real-time support for the kernel. The choice is only enabled when an architecture supports it.

It selects PREEMPT as the RT features depend on it. To achieve that the existing PREEMPT choice is renamed to PREEMPT_LL which select PREEMPT as well.

No functional change.

As one of the stable-rt maintainers I love to see this move forward!

#13 lore raw

PATCH v2 1/1 Kconfig: Introduce CONFIG_PREEMPT_RT

In reply to Thomas Gleixner

Add a new entry to the preemption menu which enables the real-time support for the kernel. The choice is only enabled when an architecture supports it.

It selects PREEMPT as the RT features depend on it. To achieve that the existing PREEMPT choice is renamed to PREEMPT_LL which select PREEMPT as well.

No functional change.

---
V2: Fix typos in help text, collect acks

---
 arch/Kconfig           |    3 +++
 kernel/Kconfig.preempt |   25 +++++++++++++++++++++++--
 2 files changed, 26 insertions(+), 2 deletions(-)
arch/Kconfig +3 -0
@@ -809,6 +809,9 @@ config ARCH_NO_COHERENT_DMA_MMAP
 config ARCH_NO_PREEMPT
 	bool
 
+config ARCH_SUPPORTS_RT
+	bool
+
 config CPU_NO_EFFICIENT_FFS
 	def_bool n
 
kernel/Kconfig.preempt +23 -2
@@ -35,10 +35,10 @@ config PREEMPT_VOLUNTARY
 
 	  Select this if you are building a kernel for a desktop system.
 
-config PREEMPT
+config PREEMPT_LL
 	bool "Preemptible Kernel (Low-Latency Desktop)"
 	depends on !ARCH_NO_PREEMPT
-	select PREEMPT_COUNT
+	select PREEMPT
 	select UNINLINE_SPIN_UNLOCK if !ARCH_INLINE_SPIN_UNLOCK
 	help
 	  This option reduces the latency of the kernel by making
@@ -55,7 +55,28 @@ config PREEMPT
 	  embedded system with latency requirements in the milliseconds
 	  range.
 
+config PREEMPT_RT
+	bool "Fully Preemptible Kernel (Real-Time)"
+	depends on EXPERT && ARCH_SUPPORTS_RT
+	select PREEMPT
+	help
+	  This option turns the kernel into a real-time kernel by replacing
+	  various locking primitives (spinlocks, rwlocks, etc.) with
+	  preemptible priority-inheritance aware variants, enforcing
+	  interrupt threading and introducing mechanisms to break up long
+	  non-preemptible sections. This makes the kernel, except for very
+	  low level and critical code pathes (entry code, scheduler, low
+	  level interrupt handling) fully preemptible and brings most
+	  execution contexts under scheduler control.
+
+	  Select this if you are building a kernel for systems which
+	  require real-time guarantees.
+
 endchoice
 
 config PREEMPT_COUNT
        bool
+
+config PREEMPT
+       bool
+       select PREEMPT_COUNT
#14 lore raw

[tip:sched/urgent] sched/rt, Kconfig: Introduce CONFIG_PREEMPT_RT

sched/rt, Kconfig: Introduce CONFIG_PREEMPT_RT
Commit-ID:  2c2ffb925b368a1f00d4ddcc837f830394861d6c
Gitweb:     https://git.kernel.org/tip/2c2ffb925b368a1f00d4ddcc837f830394861d6c
Author:     Thomas Gleixner <[email protected]>
AuthorDate: Wed, 17 Jul 2019 22:01:49 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu, 18 Jul 2019 14:53:32 +0200

sched/rt, Kconfig: Introduce CONFIG_PREEMPT_RT

Add a new entry to the preemption menu which enables the real-time support for the kernel. The choice is only enabled when an architecture supports it.

It selects PREEMPT as the RT features depend on it. To achieve that the existing PREEMPT choice is renamed to PREEMPT_LL which select PREEMPT as well.

No functional change.

---
 arch/Kconfig           |  3 +++
 kernel/Kconfig.preempt | 25 +++++++++++++++++++++++--
 2 files changed, 26 insertions(+), 2 deletions(-)
arch/Kconfig +3 -0
index c47b328eada0..ada51f36bd5d 100644
@@ -801,6 +801,9 @@ config ARCH_NO_COHERENT_DMA_MMAP
 config ARCH_NO_PREEMPT
 	bool
 
+config ARCH_SUPPORTS_RT
+	bool
+
 config CPU_NO_EFFICIENT_FFS
 	def_bool n
 
kernel/Kconfig.preempt +23 -2
index dc0b682ec2d9..fc020c09b7e8 100644
@@ -35,10 +35,10 @@ config PREEMPT_VOLUNTARY
 
 	  Select this if you are building a kernel for a desktop system.
 
-config PREEMPT
+config PREEMPT_LL
 	bool "Preemptible Kernel (Low-Latency Desktop)"
 	depends on !ARCH_NO_PREEMPT
-	select PREEMPT_COUNT
+	select PREEMPT
 	select UNINLINE_SPIN_UNLOCK if !ARCH_INLINE_SPIN_UNLOCK
 	help
 	  This option reduces the latency of the kernel by making
@@ -55,7 +55,28 @@ config PREEMPT
 	  embedded system with latency requirements in the milliseconds
 	  range.
 
+config PREEMPT_RT
+	bool "Fully Preemptible Kernel (Real-Time)"
+	depends on EXPERT && ARCH_SUPPORTS_RT
+	select PREEMPT
+	help
+	  This option turns the kernel into a real-time kernel by replacing
+	  various locking primitives (spinlocks, rwlocks, etc.) with
+	  preemptible priority-inheritance aware variants, enforcing
+	  interrupt threading and introducing mechanisms to break up long
+	  non-preemptible sections. This makes the kernel, except for very
+	  low level and critical code pathes (entry code, scheduler, low
+	  level interrupt handling) fully preemptible and brings most
+	  execution contexts under scheduler control.
+
+	  Select this if you are building a kernel for systems which
+	  require real-time guarantees.
+
 endchoice
 
 config PREEMPT_COUNT
        bool
+
+config PREEMPT
+       bool
+       select PREEMPT_COUNT
Acked-by on v2 1/1
#15 lore raw
In reply to Thomas Gleixner
Quoted 20 lines · Thomas Gleixner

Add a new entry to the preemption menu which enables the real-time support for the kernel. The choice is only enabled when an architecture supports it.

It selects PREEMPT as the RT features depend on it. To achieve that the existing PREEMPT choice is renamed to PREEMPT_LL which select PREEMPT as well.

No functional change.

Quoted 1 line

---

I'm excited to see where this goes.

Julia

#16 lore raw

[tip:sched/urgent] sched/rt, Kconfig: Introduce CONFIG_PREEMPT_RT

In reply to Thomas Gleixner
sched/rt, Kconfig: Introduce CONFIG_PREEMPT_RT
Commit-ID:  a003296b7a97dedccb0c35c4c1e44e088050b8c4
Gitweb:     https://git.kernel.org/tip/a003296b7a97dedccb0c35c4c1e44e088050b8c4
Author:     Thomas Gleixner <[email protected]>
AuthorDate: Wed, 17 Jul 2019 22:01:49 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu, 18 Jul 2019 19:47:11 +0200

sched/rt, Kconfig: Introduce CONFIG_PREEMPT_RT

Add a new entry to the preemption menu which enables the real-time support for the kernel. The choice is only enabled when an architecture supports it.

It selects PREEMPT as the RT features depend on it. To achieve that the existing PREEMPT choice is renamed to PREEMPT_LL which select PREEMPT as well.

No functional change.

---
 arch/Kconfig           |  3 +++
 kernel/Kconfig.preempt | 25 +++++++++++++++++++++++--
 2 files changed, 26 insertions(+), 2 deletions(-)
arch/Kconfig +3 -0
index c47b328eada0..ada51f36bd5d 100644
@@ -801,6 +801,9 @@ config ARCH_NO_COHERENT_DMA_MMAP
 config ARCH_NO_PREEMPT
 	bool
 
+config ARCH_SUPPORTS_RT
+	bool
+
 config CPU_NO_EFFICIENT_FFS
 	def_bool n
 
kernel/Kconfig.preempt +23 -2
index dc0b682ec2d9..fc020c09b7e8 100644
@@ -35,10 +35,10 @@ config PREEMPT_VOLUNTARY
 
 	  Select this if you are building a kernel for a desktop system.
 
-config PREEMPT
+config PREEMPT_LL
 	bool "Preemptible Kernel (Low-Latency Desktop)"
 	depends on !ARCH_NO_PREEMPT
-	select PREEMPT_COUNT
+	select PREEMPT
 	select UNINLINE_SPIN_UNLOCK if !ARCH_INLINE_SPIN_UNLOCK
 	help
 	  This option reduces the latency of the kernel by making
@@ -55,7 +55,28 @@ config PREEMPT
 	  embedded system with latency requirements in the milliseconds
 	  range.
 
+config PREEMPT_RT
+	bool "Fully Preemptible Kernel (Real-Time)"
+	depends on EXPERT && ARCH_SUPPORTS_RT
+	select PREEMPT
+	help
+	  This option turns the kernel into a real-time kernel by replacing
+	  various locking primitives (spinlocks, rwlocks, etc.) with
+	  preemptible priority-inheritance aware variants, enforcing
+	  interrupt threading and introducing mechanisms to break up long
+	  non-preemptible sections. This makes the kernel, except for very
+	  low level and critical code pathes (entry code, scheduler, low
+	  level interrupt handling) fully preemptible and brings most
+	  execution contexts under scheduler control.
+
+	  Select this if you are building a kernel for systems which
+	  require real-time guarantees.
+
 endchoice
 
 config PREEMPT_COUNT
        bool
+
+config PREEMPT
+       bool
+       select PREEMPT_COUNT
Acked-by on v2 1/1
#17 lore raw
In reply to Thomas Gleixner

Hi,

Quoted 24 lines · Thomas Gleixner

Add a new entry to the preemption menu which enables the real-time support
for the kernel. The choice is only enabled when an architecture supports
it.

It selects PREEMPT as the RT features depend on it. To achieve that the
existing PREEMPT choice is renamed to PREEMPT_LL which select PREEMPT as
well.

No functional change.

Quoted 1 line

---

As one of the stable-rt maintainers, I'd obviously be very happy to see this finally go in. :-)

And will be happy to do what I can to help with the remaining 311...

Quoted 69 lines

V2: Fix typos in help text, collect acks

---
 arch/Kconfig           |    3 +++
 kernel/Kconfig.preempt |   25 +++++++++++++++++++++++--
 2 files changed, 26 insertions(+), 2 deletions(-)
arch/Kconfig +3 -0
@@ -809,6 +809,9 @@ config ARCH_NO_COHERENT_DMA_MMAP
 config ARCH_NO_PREEMPT
 	bool
 
+config ARCH_SUPPORTS_RT
+	bool
+
 config CPU_NO_EFFICIENT_FFS
 	def_bool n
 
kernel/Kconfig.preempt +0 -0
@@ -35,10 +35,10 @@ config PREEMPT_VOLUNTARY
 
 	  Select this if you are building a kernel for a desktop

system.

kernel/Kconfig.preempt +2 -2
-config PREEMPT
+config PREEMPT_LL
 	bool "Preemptible Kernel (Low-Latency Desktop)"
 	depends on !ARCH_NO_PREEMPT
-	select PREEMPT_COUNT
+	select PREEMPT
 	select UNINLINE_SPIN_UNLOCK if !ARCH_INLINE_SPIN_UNLOCK
 	help
 	  This option reduces the latency of the kernel by making
@@ -55,7 +55,28 @@ config PREEMPT
 	  embedded system with latency requirements in the

milliseconds

kernel/Kconfig.preempt +6 -0
 	  range.
 
+config PREEMPT_RT
+	bool "Fully Preemptible Kernel (Real-Time)"
+	depends on EXPERT && ARCH_SUPPORTS_RT
+	select PREEMPT
+	help
+	  This option turns the kernel into a real-time kernel by

replacing

kernel/Kconfig.preempt +3 -0
+	  various locking primitives (spinlocks, rwlocks, etc.) with
+	  preemptible priority-inheritance aware variants, enforcing
+	  interrupt threading and introducing mechanisms to break up

long

kernel/Kconfig.preempt +1 -0
+	  non-preemptible sections. This makes the kernel, except

for very

kernel/Kconfig.preempt +1 -0
+	  low level and critical code pathes (entry code, scheduler,

low

kernel/Kconfig.preempt +1 -0
+	  level interrupt handling) fully preemptible and brings

most

kernel/Kconfig.preempt +9 -0
+	  execution contexts under scheduler control.
+
+	  Select this if you are building a kernel for systems which
+	  require real-time guarantees.
+
 endchoice
 
 config PREEMPT_COUNT
        bool
+
+config PREEMPT
+       bool
+       select PREEMPT_COUNT
#18 lore raw

[tip:sched/urgent] sched/rt, Kconfig: Introduce CONFIG_PREEMPT_RT

In reply to Thomas Gleixner
sched/rt, Kconfig: Introduce CONFIG_PREEMPT_RT
Commit-ID:  a50a3f4b6a313dc76912bd4ad3b8b4f4b479c801
Gitweb:     https://git.kernel.org/tip/a50a3f4b6a313dc76912bd4ad3b8b4f4b479c801
Author:     Thomas Gleixner <[email protected]>
AuthorDate: Wed, 17 Jul 2019 22:01:49 +0200
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu, 18 Jul 2019 23:10:57 +0200

sched/rt, Kconfig: Introduce CONFIG_PREEMPT_RT

Add a new entry to the preemption menu which enables the real-time support for the kernel. The choice is only enabled when an architecture supports it.

It selects PREEMPT as the RT features depend on it. To achieve that the existing PREEMPT choice is renamed to PREEMPT_LL which select PREEMPT as well.

No functional change.

---
 arch/Kconfig           |  3 +++
 kernel/Kconfig.preempt | 25 +++++++++++++++++++++++--
 2 files changed, 26 insertions(+), 2 deletions(-)
arch/Kconfig +3 -0
index c47b328eada0..ada51f36bd5d 100644
@@ -801,6 +801,9 @@ config ARCH_NO_COHERENT_DMA_MMAP
 config ARCH_NO_PREEMPT
 	bool
 
+config ARCH_SUPPORTS_RT
+	bool
+
 config CPU_NO_EFFICIENT_FFS
 	def_bool n
 
kernel/Kconfig.preempt +23 -2
index dc0b682ec2d9..fc020c09b7e8 100644
@@ -35,10 +35,10 @@ config PREEMPT_VOLUNTARY
 
 	  Select this if you are building a kernel for a desktop system.
 
-config PREEMPT
+config PREEMPT_LL
 	bool "Preemptible Kernel (Low-Latency Desktop)"
 	depends on !ARCH_NO_PREEMPT
-	select PREEMPT_COUNT
+	select PREEMPT
 	select UNINLINE_SPIN_UNLOCK if !ARCH_INLINE_SPIN_UNLOCK
 	help
 	  This option reduces the latency of the kernel by making
@@ -55,7 +55,28 @@ config PREEMPT
 	  embedded system with latency requirements in the milliseconds
 	  range.
 
+config PREEMPT_RT
+	bool "Fully Preemptible Kernel (Real-Time)"
+	depends on EXPERT && ARCH_SUPPORTS_RT
+	select PREEMPT
+	help
+	  This option turns the kernel into a real-time kernel by replacing
+	  various locking primitives (spinlocks, rwlocks, etc.) with
+	  preemptible priority-inheritance aware variants, enforcing
+	  interrupt threading and introducing mechanisms to break up long
+	  non-preemptible sections. This makes the kernel, except for very
+	  low level and critical code pathes (entry code, scheduler, low
+	  level interrupt handling) fully preemptible and brings most
+	  execution contexts under scheduler control.
+
+	  Select this if you are building a kernel for systems which
+	  require real-time guarantees.
+
 endchoice
 
 config PREEMPT_COUNT
        bool
+
+config PREEMPT
+       bool
+       select PREEMPT_COUNT
Acked-by on v1 1/1
#19 lore raw
In reply to Thomas Gleixner
Quoted 4 lines · Thomas Gleixner

Add a new entry to the preemption menu which enables the real-time support for the kernel. The choice is only enabled when an architecture supports it.

Quoted 8 lines

It selects PREEMPT as the RT features depend on it. To achieve that the existing PREEMPT choice is renamed to PREEMPT_LL which select PREEMPT as well.

No functional change.

---

Glad to see this important step being taken!