Skip to content

Commit b26e52c

Browse files
committed
slab: add SLAB_CONSISTENCY_CHECKS to SLAB_NEVER_MERGE
All the debug flags prevent merging, except SLAB_CONSISTENCY_CHECKS. This is suboptimal because this flag (like any debug flags) prevents the usage of any fastpaths, and thus affect performance of any aliased cache. Also the objects from an aliased cache than the one specified for debugging could also interfere with the debugging efforts. Fix this by adding the whole SLAB_DEBUG_FLAGS collection to SLAB_NEVER_MERGE instead of individual debug flags, so it now also includes SLAB_CONSISTENCY_CHECKS. Reviewed-by: Suren Baghdasaryan <surenb@google.com> Reviewed-by: Harry Yoo <harry.yoo@oracle.com> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
1 parent f8b4cd2 commit b26e52c

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

mm/slab_common.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,8 @@ struct kmem_cache *kmem_cache;
4545
/*
4646
* Set of flags that will prevent slab merging
4747
*/
48-
#define SLAB_NEVER_MERGE (SLAB_RED_ZONE | SLAB_POISON | SLAB_STORE_USER | \
49-
SLAB_TRACE | SLAB_TYPESAFE_BY_RCU | SLAB_NOLEAKTRACE | \
50-
SLAB_FAILSLAB | SLAB_NO_MERGE)
48+
#define SLAB_NEVER_MERGE (SLAB_DEBUG_FLAGS | SLAB_TYPESAFE_BY_RCU | \
49+
SLAB_NOLEAKTRACE | SLAB_FAILSLAB | SLAB_NO_MERGE)
5150

5251
#define SLAB_MERGE_SAME (SLAB_RECLAIM_ACCOUNT | SLAB_CACHE_DMA | \
5352
SLAB_CACHE_DMA32 | SLAB_ACCOUNT)

0 commit comments

Comments
 (0)