From: Zhong Li <zhong@linux.vnet.ibm.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Christoph Lameter <cl@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>,
Pekka Enberg <penberg@kernel.org>, linux-mm <linux-mm@kvack.org>,
Paul Mackerras <paulus@samba.org>, Matt Mackall <mpm@selenic.com>,
PowerPC email list <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH powerpc 2/2] kfree the cache name of pgtable cache if SLUB is used
Date: Fri, 29 Jun 2012 09:41:33 +0800 [thread overview]
Message-ID: <4FED07CD.6000203@linux.vnet.ibm.com> (raw)
In-Reply-To: <1340930720.2563.5.camel@pasglop>
On 06/29/2012 08:45 AM, Benjamin Herrenschmidt wrote:
> On Mon, 2012-06-25 at 17:54 +0800, Li Zhong wrote:
>
>> diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
>> index 620b7ac..c9d2a7f 100644
>> --- a/arch/powerpc/mm/init_64.c
>> +++ b/arch/powerpc/mm/init_64.c
>> @@ -130,6 +130,9 @@ 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);
>> +#ifdef CONFIG_SLUB
>> + kfree(name); /* SLUB duplicates the cache name */
>> +#endif
>> PGT_CACHE(shift) = new;
>>
>> pr_debug("Allocated pgtable cache for order %d\n", shift);
>
> This is very gross ... and fragile. Also the subtle difference in
> semantics between SLUB and SLAB is a VERY BAD IDEA.
I agree.
> I reckon you should make the other allocators all copy the name
> instead.
Thank you for the suggestion. I will do it in the next version.
Thanks, Zhong
> Ben.
>
>
WARNING: multiple messages have this Message-ID (diff)
From: Zhong Li <zhong@linux.vnet.ibm.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Christoph Lameter <cl@linux-foundation.org>,
Pekka Enberg <penberg@kernel.org>, Matt Mackall <mpm@selenic.com>,
Paul Mackerras <paulus@samba.org>, linux-mm <linux-mm@kvack.org>,
PowerPC email list <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH powerpc 2/2] kfree the cache name of pgtable cache if SLUB is used
Date: Fri, 29 Jun 2012 09:41:33 +0800 [thread overview]
Message-ID: <4FED07CD.6000203@linux.vnet.ibm.com> (raw)
In-Reply-To: <1340930720.2563.5.camel@pasglop>
On 06/29/2012 08:45 AM, Benjamin Herrenschmidt wrote:
> On Mon, 2012-06-25 at 17:54 +0800, Li Zhong wrote:
>
>> diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
>> index 620b7ac..c9d2a7f 100644
>> --- a/arch/powerpc/mm/init_64.c
>> +++ b/arch/powerpc/mm/init_64.c
>> @@ -130,6 +130,9 @@ 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);
>> +#ifdef CONFIG_SLUB
>> + kfree(name); /* SLUB duplicates the cache name */
>> +#endif
>> PGT_CACHE(shift) = new;
>>
>> pr_debug("Allocated pgtable cache for order %d\n", shift);
>
> This is very gross ... and fragile. Also the subtle difference in
> semantics between SLUB and SLAB is a VERY BAD IDEA.
I agree.
> I reckon you should make the other allocators all copy the name
> instead.
Thank you for the suggestion. I will do it in the next version.
Thanks, Zhong
> Ben.
>
>
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
WARNING: multiple messages have this Message-ID (diff)
From: Zhong Li <zhong@linux.vnet.ibm.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
Christoph Lameter <cl@linux-foundation.org>,
Pekka Enberg <penberg@kernel.org>, Matt Mackall <mpm@selenic.com>,
Paul Mackerras <paulus@samba.org>, linux-mm <linux-mm@kvack.org>,
PowerPC email list <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH powerpc 2/2] kfree the cache name of pgtable cache if SLUB is used
Date: Fri, 29 Jun 2012 09:41:33 +0800 [thread overview]
Message-ID: <4FED07CD.6000203@linux.vnet.ibm.com> (raw)
In-Reply-To: <1340930720.2563.5.camel@pasglop>
On 06/29/2012 08:45 AM, Benjamin Herrenschmidt wrote:
> On Mon, 2012-06-25 at 17:54 +0800, Li Zhong wrote:
>
>> diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
>> index 620b7ac..c9d2a7f 100644
>> --- a/arch/powerpc/mm/init_64.c
>> +++ b/arch/powerpc/mm/init_64.c
>> @@ -130,6 +130,9 @@ 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);
>> +#ifdef CONFIG_SLUB
>> + kfree(name); /* SLUB duplicates the cache name */
>> +#endif
>> PGT_CACHE(shift) = new;
>>
>> pr_debug("Allocated pgtable cache for order %d\n", shift);
>
> This is very gross ... and fragile. Also the subtle difference in
> semantics between SLUB and SLAB is a VERY BAD IDEA.
I agree.
> I reckon you should make the other allocators all copy the name
> instead.
Thank you for the suggestion. I will do it in the next version.
Thanks, Zhong
> Ben.
>
>
next prev parent reply other threads:[~2012-06-29 1:42 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-25 9:53 [PATCH SLUB 1/2] duplicate the cache name in saved_alias list Li Zhong
2012-06-25 9:53 ` Li Zhong
2012-06-25 9:53 ` Li Zhong
2012-06-25 9:54 ` [PATCH powerpc 2/2] kfree the cache name of pgtable cache if SLUB is used Li Zhong
2012-06-25 9:54 ` Li Zhong
2012-06-25 9:54 ` Li Zhong
2012-06-29 0:45 ` Benjamin Herrenschmidt
2012-06-29 0:45 ` Benjamin Herrenschmidt
2012-06-29 0:45 ` Benjamin Herrenschmidt
2012-06-29 1:41 ` Zhong Li [this message]
2012-06-29 1:41 ` Zhong Li
2012-06-29 1:41 ` Zhong Li
2012-07-03 18:48 ` Christoph Lameter
2012-07-03 18:48 ` Christoph Lameter
2012-07-03 18:48 ` Christoph Lameter
2012-07-03 20:36 ` Christoph Lameter
2012-07-03 20:36 ` Christoph Lameter
2012-07-03 20:36 ` Christoph Lameter
2012-07-04 9:00 ` Li Zhong
2012-07-04 9:00 ` Li Zhong
2012-07-04 9:00 ` Li Zhong
2012-07-04 12:40 ` Glauber Costa
2012-07-04 12:40 ` Glauber Costa
2012-07-04 12:40 ` Glauber Costa
2012-07-05 1:41 ` Li Zhong
2012-07-05 1:41 ` Li Zhong
2012-07-05 1:41 ` Li Zhong
2012-07-05 8:23 ` Glauber Costa
2012-07-05 8:23 ` Glauber Costa
2012-07-05 8:23 ` Glauber Costa
2012-07-05 9:29 ` Li Zhong
2012-07-05 9:29 ` Li Zhong
2012-07-05 9:29 ` Li Zhong
2012-07-06 10:13 ` Glauber Costa
2012-07-06 10:13 ` Glauber Costa
2012-07-06 10:13 ` Glauber Costa
2012-07-09 1:48 ` Li Zhong
2012-07-09 1:48 ` Li Zhong
2012-07-09 1:48 ` Li Zhong
2012-06-25 10:54 ` [PATCH SLUB 1/2] duplicate the cache name in saved_alias list Wanlong Gao
2012-06-25 10:54 ` Wanlong Gao
2012-06-25 10:54 ` Wanlong Gao
2012-06-26 2:49 ` Li Zhong
2012-06-26 2:49 ` Li Zhong
2012-06-26 2:49 ` Li Zhong
2012-06-25 11:10 ` Glauber Costa
2012-06-25 11:10 ` Glauber Costa
2012-06-25 11:10 ` Glauber Costa
2012-06-26 2:58 ` Li Zhong
2012-06-26 2:58 ` Li Zhong
2012-06-26 2:58 ` Li Zhong
2012-06-27 7:53 ` [PATCH SLUB 1/2 v2] " Li Zhong
2012-06-27 7:53 ` Li Zhong
2012-06-27 7:53 ` Li Zhong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FED07CD.6000203@linux.vnet.ibm.com \
--to=zhong@linux.vnet.ibm.com \
--cc=benh@kernel.crashing.org \
--cc=cl@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpm@selenic.com \
--cc=paulus@samba.org \
--cc=penberg@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.