]> Gentwo Git Trees - linux/.git/commit
SLUB: Add support for per object memory policies sent/20240819-strict_numa-fc59b33123a2-v3
authorChristoph Lameter <cl@gentwo.org>
Fri, 6 Sep 2024 15:53:58 +0000 (08:53 -0700)
committerChristoph Lameter <cl@gentwo.org>
Tue, 1 Oct 2024 19:08:28 +0000 (12:08 -0700)
commit0116c22df6da56d2be4f313072880998b46e019b
treee764fca8f9a49c08701d9e0be4283f573d1204c1
parente32cde8d2bd7d251a8f9b434143977ddf13dcec6
SLUB: Add support for per object memory policies

    The old SLAB allocator used to support memory policies on a per
    allocation bases. In SLUB the memory policies are applied on a
    per page frame / folio bases. Doing so avoids having to check memory
    policies in critical code paths for kmalloc and friends.

    This worked on general well on Intel/AMD/PowerPC because the
    interconnect technology is mature and can minimize the latencies
    through intelligent caching even if a small object is not
    placed optimally.

    However, on ARM we have an emergence of new NUMA interconnect
    technology based more on embedded devices. Caching of remote content
    can currently be ineffective using the standard building blocks / mesh
    available on that platform. Such architectures benefit if each slab
    object is individually placed according to memory policies
    and other restrictions.

    This patch adds another kernel parameter

            slab_strict_numa

    If that is set then a static branch is activated that will cause
    the hotpaths of the allocator to evaluate the current memory
    allocation policy. Each object will be properly placed by
    paying the price of extra processing and SLUB will no longer
    defer to the page allocator to apply memory policies at the
    folio level.

    This patch improves performance of memcached running
    on Ampere Altra 2P system (ARM Neoverse N1 processor)
    by 3.6% due to accurate placement of small kernel objects.

Tested-by: Huang Shijie <shijie@os.amperecomputing.com>
Signed-off-by: Christoph Lameter (Ampere) <cl@gentwo.org>
mm/slub.c