From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:42932 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751012AbdJSNU3 (ORCPT ); Thu, 19 Oct 2017 09:20:29 -0400 Subject: Patch "slub: do not merge cache if slub_debug contains a never-merge flag" has been added to the 4.4-stable tree To: grygoriimkd@gmail.com, akpm@linux-foundation.org, alexander.levin@verizon.com, cl@linux.com, gregkh@linuxfoundation.org, iamjoonsoo.kim@lge.com, penberg@kernel.org, rientjes@google.com, torvalds@linux-foundation.org Cc: , From: Date: Thu, 19 Oct 2017 15:19:56 +0200 Message-ID: <15084191961637@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled slub: do not merge cache if slub_debug contains a never-merge flag to the 4.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: slub-do-not-merge-cache-if-slub_debug-contains-a-never-merge-flag.patch and it can be found in the queue-4.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From foo@baz Thu Oct 19 15:15:46 CEST 2017 From: Grygorii Maistrenko Date: Wed, 22 Feb 2017 15:40:59 -0800 Subject: slub: do not merge cache if slub_debug contains a never-merge flag From: Grygorii Maistrenko [ Upstream commit c6e28895a4372992961888ffaadc9efc643b5bfe ] 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 Reviewed-by: Pekka Enberg Acked-by: David Rientjes Acked-by: Christoph Lameter Cc: Joonsoo Kim Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- mm/slab_common.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -250,7 +250,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) @@ -261,6 +261,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 stable-queue which might be from grygoriimkd@gmail.com are queue-4.4/slub-do-not-merge-cache-if-slub_debug-contains-a-never-merge-flag.patch