From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752661AbdKLBkg (ORCPT ); Sat, 11 Nov 2017 20:40:36 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:64583 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752443AbdKLBkf (ORCPT ); Sat, 11 Nov 2017 20:40:35 -0500 X-UUID: 09ee05ca69ef4d44b65aa022120181da-20171112 Message-ID: <1510450823.27196.2.camel@mtkswgap22> Subject: Re: [PATCH] slub: Fix sysfs duplicate filename creation when slub_debug=O From: Miles Chen To: Christopher Lameter CC: Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , , , , Date: Sun, 12 Nov 2017 09:40:23 +0800 In-Reply-To: References: <1510023934-17517-1-git-send-email-miles.chen@mediatek.com> <1510119138.17435.19.camel@mtkswgap22> <1510217554.32371.17.camel@mtkswgap22> <1510271512.11555.3.camel@mtkswgap22> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2017-11-10 at 10:02 -0600, Christopher Lameter wrote: > 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 > Thanks for the ack, I already sent a v2 patch to fix a build warning in this patch.(fix a build error: use instead DEBUG_METADATA_FLAGS of SLAB_NEVER_MERGE) diff --git a/mm/slub.c b/mm/slub.c index 1efbb812..8e1c027 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 & DEBUG_METADATA_FLAGS)) + unmergeable = 1; + if (unmergeable) { /* * Slabcache can never be merged so we can use the name proper.