Skip to content

Commit 252220d

Browse files
Ingo Molnartorvalds
authored andcommitted
mm: allow only SLUB on PREEMPT_RT
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. [[email protected]: commit description] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Acked-by: Vlastimil Babka <[email protected]> Cc: Christoph Lameter <[email protected]> Cc: Pekka Enberg <[email protected]> Cc: David Rientjes <[email protected]> Cc: Joonsoo Kim <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 0093de6 commit 252220d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

init/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1896,6 +1896,7 @@ choice
18961896

18971897
config SLAB
18981898
bool "SLAB"
1899+
depends on !PREEMPT_RT
18991900
select HAVE_HARDENED_USERCOPY_ALLOCATOR
19001901
help
19011902
The regular slab allocator that is established and known to work
@@ -1916,6 +1917,7 @@ config SLUB
19161917
config SLOB
19171918
depends on EXPERT
19181919
bool "SLOB (Simple Allocator)"
1920+
depends on !PREEMPT_RT
19191921
help
19201922
SLOB replaces the stock allocator with a drastically simpler
19211923
allocator. SLOB is generally more space efficient but

0 commit comments

Comments
 (0)