]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
slab: remove cpu (partial) slabs usage from allocation paths
authorVlastimil Babka <vbabka@suse.cz>
Fri, 23 Jan 2026 06:52:49 +0000 (07:52 +0100)
committerVlastimil Babka <vbabka@suse.cz>
Thu, 29 Jan 2026 08:29:26 +0000 (09:29 +0100)
commit17c38c88294d75506c67cae378c9e940d1ce55e3
tree22a267852564574b586d2ef36cd1821d2e14b186
parented30c4adfc2b56909ca43fb5e4750a646928cbf4
slab: remove cpu (partial) slabs usage from allocation paths

We now rely on sheaves as the percpu caching layer and can refill them
directly from partial or newly allocated slabs. Start removing the cpu
(partial) slabs code, first from allocation paths.

This means that any allocation not satisfied from percpu sheaves will
end up in ___slab_alloc(), where we remove the usage of cpu (partial)
slabs, so it will only perform get_partial() or new_slab(). In the
latter case we reuse alloc_from_new_slab() (when we don't use
the debug/tiny alloc_single_from_new_slab() variant).

In get_partial_node() we used to return a slab for freezing as the cpu
slab and to refill the partial slab. Now we only want to return a single
object and leave the slab on the list (unless it became full). We can't
simply reuse alloc_single_from_partial() as that assumes freeing uses
free_to_partial_list(). Instead we need to use __slab_update_freelist()
to work properly against a racing __slab_free().

To reflect the new purpose of get_partial() functions, rename them to
get_from_partial(), get_from_partial_node(), and get_from_any_partial().

The rest of the changes is removing functions that no longer have any
callers.

Reviewed-by: Harry Yoo <harry.yoo@oracle.com>
Reviewed-by: Hao Li <hao.li@linux.dev>
Reviewed-by: Suren Baghdasaryan <surenb@google.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
mm/slub.c