summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorKees Cook <kees@kernel.org>2024-07-01 21:13:00 +0200
committerVlastimil Babka <vbabka@suse.cz>2024-07-03 12:24:19 +0200
commit2e8000b826fcd2716449d09753d5ed843067881e (patch)
treeb33af054aa12947149b094075755e59faf078c36 /include
parentmm/slab: Plumb kmem_buckets into __do_kmalloc_node() (diff)
downloadlinux-2e8000b826fcd2716449d09753d5ed843067881e.tar.xz
linux-2e8000b826fcd2716449d09753d5ed843067881e.zip
mm/slab: Introduce kvmalloc_buckets_node() that can take kmem_buckets argument
Plumb kmem_buckets arguments through kvmalloc_node_noprof() so it is possible to provide an API to perform kvmalloc-style allocations with a particular set of buckets. Introduce kvmalloc_buckets_node() that takes a kmem_buckets argument. Signed-off-by: Kees Cook <kees@kernel.org> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Diffstat (limited to 'include')
-rw-r--r--include/linux/slab.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/slab.h b/include/linux/slab.h
index a9200d453087..837005314f96 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -799,7 +799,9 @@ static inline __alloc_size(1) void *kzalloc_noprof(size_t size, gfp_t flags)
#define kzalloc(...) alloc_hooks(kzalloc_noprof(__VA_ARGS__))
#define kzalloc_node(_size, _flags, _node) kmalloc_node(_size, (_flags)|__GFP_ZERO, _node)
-extern void *kvmalloc_node_noprof(size_t size, gfp_t flags, int node) __alloc_size(1);
+void *__kvmalloc_node_noprof(DECL_BUCKET_PARAMS(size, b), gfp_t flags, int node) __alloc_size(1);
+#define kvmalloc_node_noprof(size, flags, node) \
+ __kvmalloc_node_noprof(PASS_BUCKET_PARAMS(size, NULL), flags, node)
#define kvmalloc_node(...) alloc_hooks(kvmalloc_node_noprof(__VA_ARGS__))
#define kvmalloc(_size, _flags) kvmalloc_node(_size, _flags, NUMA_NO_NODE)