]> Gentwo Git Trees - linux/.git/commit
Reenable NUMA policy support in the slab allocator sent/20240806-numa_policy-5188f44ba0d8-v1
authorChristoph Lameter <cl@gentwo.org>
Tue, 6 Aug 2024 22:13:49 +0000 (15:13 -0700)
committerChristoph Lameter <cl@gentwo.org>
Mon, 19 Aug 2024 18:54:23 +0000 (11:54 -0700)
commit75737d9a0d1f842f830ebc6e2e5a6c31ca72c2b2
tree6fe89dca834e0e9c1c8ca74337d7f6bb30b871cf
parentb0da640826ba3b6506b4996a6b23a429235e6923
Reenable NUMA policy support in the slab allocator

Revert commit 8014c46ad991 ("slub: use alloc_pages_node() in alloc_slab_page()").

The patch disabled the numa policy support in the slab allocator. It
did not consider that alloc_pages() uses memory policies but
alloc_pages_node() does not.

As a result of this patch slab memory allocations are no longer spread via
interleave policy across all available NUMA nodes on bootup. Instead
all slab memory is allocated close to the boot processor. This leads to
an imbalance of memory accesses on NUMA systems.

Also applications using MPOL_INTERLEAVE as a memory policy will no longer
spread slab allocations over all nodes in the interleave set but allocate
memory locally. This may also result in unbalanced allocations
on a single numa node.

SLUB does not apply memory policies to individual object allocations.
However, it relies on the page allocators support of memory policies
through alloc_pages() to do the NUMA memory allocations on a per
folio or page level. SLUB also applies memory policies when retrieving
partial allocated slab pages from the partial list.

Fixes: 8014c46ad991 ("slub: use alloc_pages_node() in alloc_slab_page()")
Cc: stable@kernel.org
Signed-off-by: Christoph Lameter <cl@gentwo.org>
mm/slub.c