From patchwork Fri Jul 6 07:57:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Zhong X-Patchwork-Id: 169361 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id 0DDB52C0376 for ; Fri, 6 Jul 2012 17:58:19 +1000 (EST) Received: from e23smtp01.au.ibm.com (e23smtp01.au.ibm.com [202.81.31.143]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "e23smtp01.au.ibm.com", Issuer "GeoTrust SSL CA" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 3E2F42C0086 for ; Fri, 6 Jul 2012 17:57:52 +1000 (EST) Received: from /spool/local by e23smtp01.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 6 Jul 2012 07:48:10 +1000 Received: from d23relay04.au.ibm.com (202.81.31.246) by e23smtp01.au.ibm.com (202.81.31.207) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 6 Jul 2012 07:48:08 +1000 Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q667o3je65405132 for ; Fri, 6 Jul 2012 17:50:03 +1000 Received: from d23av03.au.ibm.com (loopback [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q667vkde018924 for ; Fri, 6 Jul 2012 17:57:48 +1000 Received: from [9.123.247.203] ([9.123.247.203]) by d23av03.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q667vfRU018694 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO); Fri, 6 Jul 2012 17:57:44 +1000 Message-ID: <1341561460.24895.12.camel@ThinkPad-T420> Subject: [PATCH powerpc 2/2 v3] kfree the cache name of pgtable cache From: Li Zhong To: LKML Date: Fri, 06 Jul 2012 15:57:40 +0800 In-Reply-To: <1341561286.24895.9.camel@ThinkPad-T420> References: <1341561286.24895.9.camel@ThinkPad-T420> X-Mailer: Evolution 3.2.3-0ubuntu6 Mime-Version: 1.0 x-cbid: 12070521-1618-0000-0000-0000020385BA Cc: Christoph Lameter , Glauber Costa , Pekka Enberg , linux-mm , Paul Mackerras , Matt Mackall , PowerPC email list , Wanlong Gao X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" This patch tries to kfree the cache name of pgtables cache. It depends on patch 1/2 -- ([PATCH SLAB 1/2 v3] duplicate the cache name in SLUB's saved_alias list, SLAB, and SLOB) in this mail thread. For SLUB, as the pgtables cache might be mergeable to other caches. During early boot, the name string is saved in the save_alias list. In this case, the name could be safely kfreed after calling kmem_cache_create() with patch 1. For SLAB/SLOB, we need the changes in patch 1, which duplicates the name strings in cache create. v3: with patch 1/2 updated to make slab/slob consistent, #ifdef CONFIG_SLUB is no longer needed. Signed-off-by: Li Zhong --- arch/powerpc/mm/init_64.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) pr_debug("Allocated pgtable cache for order %d\n", shift); diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c index 620b7ac..bc7f462 100644 --- a/arch/powerpc/mm/init_64.c +++ b/arch/powerpc/mm/init_64.c @@ -130,6 +130,7 @@ void pgtable_cache_add(unsigned shift, void (*ctor)(void *)) align = max_t(unsigned long, align, minalign); name = kasprintf(GFP_KERNEL, "pgtable-2^%d", shift); new = kmem_cache_create(name, table_size, align, 0, ctor); + kfree(name); PGT_CACHE(shift) = new;