linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: Allow only SLUB on PREEMPT_RT
@ 2021-10-15 21:03 Sebastian Andrzej Siewior
  2021-10-15 21:21 ` Vlastimil Babka
  0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Andrzej Siewior @ 2021-10-15 21:03 UTC (permalink / raw)
  To: linux-mm
  Cc: Christoph Lameter, Pekka Enberg, David Rientjes, Joonsoo Kim,
	Andrew Morton, Vlastimil Babka, Ingo Molnar, Thomas Gleixner

From: Ingo Molnar <mingo@kernel.org>
Date: Fri, 3 Jul 2009 08:44:03 -0500

Memory allocators may disable interrupts or preemption as part of the
allocation and freeing process. For PREEMPT_RT it is important that
these sections remain deterministic and short and therefore don't depend
on the size of the memory to allocate/ free or the inner state of the
algorithm.

Until v3.12-RT the SLAB allocator was an option but involved several
changes to meet all the requirements. The SLUB design fits better with
PREEMPT_RT model and so the SLAB patches were dropped in the 3.12-RT
patchset. Comparing the two allocator, SLUB outperformed SLAB in both
throughput (time needed to allocate and free memory) and the maximal
latency of the system measured with cyclictest during hackbench.

SLOB was never evaluated since it was unlikely that it preforms better
than SLAB. During a quick test, the kernel crashed with SLOB enabled
during boot.

Disable SLAB and SLOB on PREEMPT_RT.

[bigeasy: commit description.]

Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
 init/Kconfig |    2 ++
 1 file changed, 2 insertions(+)

--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1896,6 +1896,7 @@ choice
 
 config SLAB
 	bool "SLAB"
+	depends on !PREEMPT_RT
 	select HAVE_HARDENED_USERCOPY_ALLOCATOR
 	help
 	  The regular slab allocator that is established and known to work
@@ -1916,6 +1917,7 @@ config SLUB
 config SLOB
 	depends on EXPERT
 	bool "SLOB (Simple Allocator)"
+	depends on !PREEMPT_RT
 	help
 	   SLOB replaces the stock allocator with a drastically simpler
 	   allocator. SLOB is generally more space efficient but


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

* Re: [PATCH] mm: Allow only SLUB on PREEMPT_RT
  2021-10-15 21:03 [PATCH] mm: Allow only SLUB on PREEMPT_RT Sebastian Andrzej Siewior
@ 2021-10-15 21:21 ` Vlastimil Babka
  0 siblings, 0 replies; 2+ messages in thread
From: Vlastimil Babka @ 2021-10-15 21:21 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior, linux-mm
  Cc: Christoph Lameter, Pekka Enberg, David Rientjes, Joonsoo Kim,
	Andrew Morton, Ingo Molnar, Thomas Gleixner

On 10/15/21 11:03 PM, Sebastian Andrzej Siewior wrote:
> From: Ingo Molnar <mingo@kernel.org>
> Date: Fri, 3 Jul 2009 08:44:03 -0500
> 
> Memory allocators may disable interrupts or preemption as part of the
> allocation and freeing process. For PREEMPT_RT it is important that
> these sections remain deterministic and short and therefore don't depend
> on the size of the memory to allocate/ free or the inner state of the
> algorithm.
> 
> Until v3.12-RT the SLAB allocator was an option but involved several
> changes to meet all the requirements. The SLUB design fits better with
> PREEMPT_RT model and so the SLAB patches were dropped in the 3.12-RT
> patchset. Comparing the two allocator, SLUB outperformed SLAB in both
> throughput (time needed to allocate and free memory) and the maximal
> latency of the system measured with cyclictest during hackbench.
> 
> SLOB was never evaluated since it was unlikely that it preforms better
> than SLAB. During a quick test, the kernel crashed with SLOB enabled
> during boot.
> 
> Disable SLAB and SLOB on PREEMPT_RT.
> 
> [bigeasy: commit description.]
> 
> Signed-off-by: Ingo Molnar <mingo@kernel.org>
> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

Acked-by: Vlastimil Babka <vbabka@suse.cz>

> ---
>  init/Kconfig |    2 ++
>  1 file changed, 2 insertions(+)
> 
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -1896,6 +1896,7 @@ choice
>  
>  config SLAB
>  	bool "SLAB"
> +	depends on !PREEMPT_RT
>  	select HAVE_HARDENED_USERCOPY_ALLOCATOR
>  	help
>  	  The regular slab allocator that is established and known to work
> @@ -1916,6 +1917,7 @@ config SLUB
>  config SLOB
>  	depends on EXPERT
>  	bool "SLOB (Simple Allocator)"
> +	depends on !PREEMPT_RT
>  	help
>  	   SLOB replaces the stock allocator with a drastically simpler
>  	   allocator. SLOB is generally more space efficient but
> 



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

end of thread, other threads:[~2021-10-15 21:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-15 21:03 [PATCH] mm: Allow only SLUB on PREEMPT_RT Sebastian Andrzej Siewior
2021-10-15 21:21 ` Vlastimil Babka

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