]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mm/slub: allow to set node and align in k[v]realloc
authorVitaly Wool <vitaly.wool@konsulko.se>
Wed, 6 Aug 2025 12:41:47 +0000 (14:41 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 13 Sep 2025 23:54:45 +0000 (16:54 -0700)
commit2cd8231796b5e7133b1c3d66ad7d2a3c42c97258
treea1d871cfe3ade3975123650da4620ca4b231fc79
parent4c5d3365882dbbc0784688784904f440d7a4c0f1
mm/slub: allow to set node and align in k[v]realloc

Reimplement k[v]realloc_node() to be able to set node and alignment should
a user need to do so.  In order to do that while retaining the maximal
backward compatibility, add k[v]realloc_node_align() functions and
redefine the rest of API using these new ones.

While doing that, we also keep the number of _noprof variants to a
minimum, which implies some changes to the existing users of older _noprof
functions, that basically being bcachefs.

With that change we also provide the ability for the Rust part of the
kernel to set node and alignment in its K[v]xxx [re]allocations.

Link: https://lkml.kernel.org/r/20250806124147.1724658-1-vitaly.wool@konsulko.se
Signed-off-by: Vitaly Wool <vitaly.wool@konsulko.se>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Alice Ryhl <aliceryhl@google.com>
Cc: Danilo Krummrich <dakr@kernel.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Jann Horn <jannh@google.com>
Cc: Kent Overstreet <kent.overstreet@linux.dev>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Uladzislau Rezki (Sony) <urezki@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/bcachefs/darray.c
fs/bcachefs/util.h
include/linux/bpfptr.h
include/linux/slab.h
lib/rhashtable.c
mm/slub.c