mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 10:04:04 +02:00
mm/slab: make caches with sheaves mergeable
Before enabling sheaves for all caches (with automatically determined capacity), their enablement should no longer prevent merging of caches. Limit this merge prevention only to caches that were created with a specific sheaf capacity, by adding the SLAB_NO_MERGE flag to them. Reviewed-by: Harry Yoo <harry.yoo@oracle.com> Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
This commit is contained in:
parent
8598351edc
commit
aff8518575
|
|
@ -162,9 +162,6 @@ int slab_unmergeable(struct kmem_cache *s)
|
|||
return 1;
|
||||
#endif
|
||||
|
||||
if (s->cpu_sheaves)
|
||||
return 1;
|
||||
|
||||
/*
|
||||
* We may have set a slab to be unmergeable during bootstrap.
|
||||
*/
|
||||
|
|
@ -189,9 +186,6 @@ static struct kmem_cache *find_mergeable(unsigned int size, slab_flags_t flags,
|
|||
if (IS_ENABLED(CONFIG_HARDENED_USERCOPY) && args->usersize)
|
||||
return NULL;
|
||||
|
||||
if (args->sheaf_capacity)
|
||||
return NULL;
|
||||
|
||||
flags = kmem_cache_flags(flags, name);
|
||||
|
||||
if (flags & SLAB_NEVER_MERGE)
|
||||
|
|
@ -336,6 +330,13 @@ struct kmem_cache *__kmem_cache_create_args(const char *name,
|
|||
flags &= ~SLAB_DEBUG_FLAGS;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Caches with specific capacity are special enough. It's simpler to
|
||||
* make them unmergeable.
|
||||
*/
|
||||
if (args->sheaf_capacity)
|
||||
flags |= SLAB_NO_MERGE;
|
||||
|
||||
mutex_lock(&slab_mutex);
|
||||
|
||||
err = kmem_cache_sanity_check(name, object_size);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user