diff mbox

slub: Fix sysfs duplicate filename creation when slub_debug=O

Message ID 1510271512.11555.3.camel@mtkswgap22 (mailing list archive)
State New, archived
Headers show

Commit Message

Miles Chen Nov. 9, 2017, 11:51 p.m. UTC
On Thu, 2017-11-09 at 09:49 -0600, Christopher Lameter wrote:
> On Thu, 9 Nov 2017, Miles Chen wrote:
> 
> > In this fix patch, it disables slab merging if SLUB_DEBUG=O and
> > CONFIG_SLUB_DEBUG_ON=y but the debug features are disabled by the
> > disable_higher_order_debug logic and it holds the "slab merging is off
> > if any debug features are enabled" behavior.
> 
> Sounds good. Where is the patch?
> 
> 
Sorry for confusing, I meant the original patch of this thread :-)

By checking disable_higher_order_debug & (slub_debug &
SLAB_NEVER_MERGE), we can detect if a cache is unmergeable but become
mergeable because the disable_higher_order_debug=1 logic. Those kind of
caches should be keep unmergeable.


proper.

Comments

Christoph Lameter (Ampere) Nov. 10, 2017, 4:02 p.m. UTC | #1
On Fri, 10 Nov 2017, Miles Chen wrote:

> By checking disable_higher_order_debug & (slub_debug &
> SLAB_NEVER_MERGE), we can detect if a cache is unmergeable but become
> mergeable because the disable_higher_order_debug=1 logic. Those kind of
> caches should be keep unmergeable.

Acked-by: Christoph Lameter <cl@linux.com>
diff mbox

Patch

diff --git a/mm/slub.c b/mm/slub.c
index 1efbb812..8cbf9f7 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -5704,6 +5704,10 @@  static int sysfs_slab_add(struct kmem_cache *s)
                return 0;
        }
 
+       if (!unmergeable && disable_higher_order_debug &&
+                       (slub_debug & SLAB_NEVER_MERGE))
+               unmergeable = 1;
+
        if (unmergeable) {
                /*
                 * Slabcache can never be merged so we can use the name