Commit 72e0fe22 authored by Kees Cook's avatar Kees Cook Committed by Vlastimil Babka

mm/slab: Introduce kmem_buckets typedef

Encapsulate the concept of a single set of kmem_caches that are used
for the kmalloc size buckets. Redefine kmalloc_caches as an array
of these buckets (for the different global cache buckets).
Signed-off-by: default avatarKees Cook <kees@kernel.org>
Signed-off-by: default avatarVlastimil Babka <vbabka@suse.cz>
parent ad59baa3
...@@ -426,8 +426,9 @@ enum kmalloc_cache_type { ...@@ -426,8 +426,9 @@ enum kmalloc_cache_type {
NR_KMALLOC_TYPES NR_KMALLOC_TYPES
}; };
extern struct kmem_cache * typedef struct kmem_cache * kmem_buckets[KMALLOC_SHIFT_HIGH + 1];
kmalloc_caches[NR_KMALLOC_TYPES][KMALLOC_SHIFT_HIGH + 1];
extern kmem_buckets kmalloc_caches[NR_KMALLOC_TYPES];
/* /*
* Define gfp bits that should not be set for KMALLOC_NORMAL. * Define gfp bits that should not be set for KMALLOC_NORMAL.
......
...@@ -654,8 +654,7 @@ static struct kmem_cache *__init create_kmalloc_cache(const char *name, ...@@ -654,8 +654,7 @@ static struct kmem_cache *__init create_kmalloc_cache(const char *name,
return s; return s;
} }
struct kmem_cache * kmem_buckets kmalloc_caches[NR_KMALLOC_TYPES] __ro_after_init =
kmalloc_caches[NR_KMALLOC_TYPES][KMALLOC_SHIFT_HIGH + 1] __ro_after_init =
{ /* initialization for https://llvm.org/pr42570 */ }; { /* initialization for https://llvm.org/pr42570 */ };
EXPORT_SYMBOL(kmalloc_caches); EXPORT_SYMBOL(kmalloc_caches);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment