The patch titled Subject: slub: do not merge cache if slub_debug contains a never-merge flag has been added to the -mm tree. Its filename is slub-do-not-merge-cache-if-slub_debug-contains-a-never-merge-flag.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/slub-do-not-merge-cache-if-slub_debug-contains-a-never-merge-flag.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/slub-do-not-merge-cache-if-slub_debug-contains-a-never-merge-flag.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Grygorii Maistrenko <grygoriimkd@xxxxxxxxx> Subject: slub: do not merge cache if slub_debug contains a never-merge flag In case CONFIG_SLUB_DEBUG_ON=n, find_mergeable() gets debug features from commandline but never checks if there are features from the SLAB_NEVER_MERGE set. As a result selected by slub_debug caches are always mergeable if they have been created without a custom constructor set or without one of the SLAB_* debug features on. This moves the SLAB_NEVER_MERGE check below the flags update from commandline to make sure it won't merge the slab cache if one of the debug features is on. Link: http://lkml.kernel.org/r/20170101124451.GA4740@lp-laptop-d Signed-off-by: Grygorii Maistrenko <grygoriimkd@xxxxxxxxx> Reviewed-by: Pekka Enberg <penberg@xxxxxxxxxx> Acked-by: David Rientjes <rientjes@xxxxxxxxxx> Acked-by: Christoph Lameter <cl@xxxxxxxxx> Cc: Joonsoo Kim <iamjoonsoo.kim@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/slab_common.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff -puN mm/slab_common.c~slub-do-not-merge-cache-if-slub_debug-contains-a-never-merge-flag mm/slab_common.c --- a/mm/slab_common.c~slub-do-not-merge-cache-if-slub_debug-contains-a-never-merge-flag +++ a/mm/slab_common.c @@ -255,7 +255,7 @@ struct kmem_cache *find_mergeable(size_t { struct kmem_cache *s; - if (slab_nomerge || (flags & SLAB_NEVER_MERGE)) + if (slab_nomerge) return NULL; if (ctor) @@ -266,6 +266,9 @@ struct kmem_cache *find_mergeable(size_t size = ALIGN(size, align); flags = kmem_cache_flags(size, flags, name, NULL); + if (flags & SLAB_NEVER_MERGE) + return NULL; + list_for_each_entry_reverse(s, &slab_caches, list) { if (slab_unmergeable(s)) continue; _ Patches currently in -mm which might be from grygoriimkd@xxxxxxxxx are slub-do-not-merge-cache-if-slub_debug-contains-a-never-merge-flag.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html