From patchwork Sun Nov 12 01:40:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miles Chen X-Patchwork-Id: 10054641 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2F34A60365 for ; Sun, 12 Nov 2017 01:41:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D82229AAB for ; Sun, 12 Nov 2017 01:41:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 119FB29AF1; Sun, 12 Nov 2017 01:41:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AF34A29AAB for ; Sun, 12 Nov 2017 01:41:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Date:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=C8QZ0OudCm5KJUvVl6LsbBlMKhYacHUWJL0MBSW7sto=; b=R2FLCbcUShIYsw juhc91RCNq+Pd5ZRAXRnMHgq9vhUo56xoO+OvCV3lnkuCnhJ+CxTC5pcoE3J2bnezSs3Y793nyaaO IytUWmnNRuYdiC/rfta8UCai8Hae2G1osx1L1aiHah9uMQfuXleRBc4PLLR3GmRz9Nw2f3CVCNkwQ VTz53mw0IYzNNMeCbIF3tLbS/jnNYZigtNBcNOTbOaYwsMwQfI8sPuQlDLcdm06wKDBCqBojQfm2O K3MkgzYnLm83yB5dHhQCpVVDfXPZoc0259iNj01mzvhIBA7deupJDGcwE/IOt98HIXwHFc4iA2+Gu Kr6Gn5/lz1Ph+CVaxVnQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eDhGd-0005z3-I4; Sun, 12 Nov 2017 01:40:59 +0000 Received: from [210.61.82.183] (helo=mailgw01.mediatek.com) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eDhGa-0005uv-A0 for linux-mediatek@lists.infradead.org; Sun, 12 Nov 2017 01:40:58 +0000 X-UUID: 09ee05ca69ef4d44b65aa022120181da-20171112 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 372327931; Sun, 12 Nov 2017 09:40:30 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs03n2.mediatek.inc (172.21.101.182) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Sun, 12 Nov 2017 09:40:29 +0800 Received: from [172.21.77.33] (172.21.77.33) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Sun, 12 Nov 2017 09:40:23 +0800 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 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> X-Mailer: Evolution 3.2.3-0ubuntu6 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171111_174056_495693_567D6E86 X-CRM114-Status: GOOD ( 12.67 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: wsd_upstream@mediatek.com, linux-kernel@vger.kernel.org, Pekka Enberg , linux-mm@kvack.org, linux-mediatek@lists.infradead.org, David Rientjes , Joonsoo Kim , Andrew Morton Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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) proper. 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