From: Li Zhong <zhong@linux.vnet.ibm.com>
To: Glauber Costa <glommer@parallels.com>
Cc: 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>,
Christoph Lameter <cl@linux.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: Mon, 09 Jul 2012 09:48:53 +0800 [thread overview]
Message-ID: <1341798533.2439.13.camel@ThinkPad-T420> (raw)
In-Reply-To: <4FF6BA39.4000305@parallels.com>
On Fri, 2012-07-06 at 14:13 +0400, Glauber Costa wrote:
> On 07/05/2012 01:29 PM, Li Zhong wrote:
> > On Thu, 2012-07-05 at 12:23 +0400, Glauber Costa wrote:
> >> On 07/05/2012 05:41 AM, Li Zhong wrote:
> >>> On Wed, 2012-07-04 at 16:40 +0400, Glauber Costa wrote:
> >>>> On 07/04/2012 01:00 PM, Li Zhong wrote:
> >>>>> On Tue, 2012-07-03 at 15:36 -0500, Christoph Lameter wrote:
> >>>>>>> Looking through the emails it seems that there is an issue with alias
> >>>>>>> strings.
> >>>>> To be more precise, there seems no big issue currently. I just wanted to
> >>>>> make following usage of kmem_cache_create (SLUB) possible:
> >>>>>
> >>>>> name = some string kmalloced
> >>>>> kmem_cache_create(name, ...)
> >>>>> kfree(name);
> >>>>
> >>>> Out of curiosity: Why?
> >>>> This is not (currently) possible with the other allocators (may change
> >>>> with christoph's unification patches), so you would be making your code
> >>>> slub-dependent.
> >>>>
> >>>
> >>> For slub itself, I think it's not good that: in some cases, the name
> >>> string could be kfreed ( if it was kmalloced ) immediately after calling
> >>> the cache create; in some other case, the name string needs to be kept
> >>> valid until some init calls finished.
> >>>
> >>> I agree with you that it would make the code slub-dependent, so I'm now
> >>> working on the consistency of the other allocators regarding this name
> >>> string duplicating thing.
> >>
> >> If you really need to kfree the string, or even if it is easier for you
> >> this way, it can be done. As a matter of fact, this is the case for me.
> >> Just that your patch is not enough. Christoph has a patch that makes
> >> this behavior consistent over all allocators.
> >
> > Sorry, I didn't know that. Seems I don't need to continue the half-done
> > work in slab. If possible, would you please give me a link of the patch?
> > Thank you.
> >
>
> Sorry for the delay. In case you haven't found it out yourself yet:
>
> http://www.spinics.net/lists/linux-mm/msg36149.html
Thank you. I think it is better to have these things in the
slab_common.c.
>
> Please not this posted patch as is has a bug.
>
> I do believe that your take on the aliasing code adds value to it. But
> as I've already said once, might have to dig a bit deeper in that to get
> to end of the rabbit hole.
With slab_common, I think my slab/slob modifications are not needed any
more. After I understand the common patches, I will check whether the
aliasing problem in slub still exists, and if yes, try to send a patch
based on that.
next prev parent reply other threads:[~2012-07-09 1:49 UTC|newest]
Thread overview: 18+ 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:54 ` [PATCH powerpc 2/2] kfree the cache name of pgtable cache if SLUB is used Li Zhong
2012-06-29 0:45 ` Benjamin Herrenschmidt
2012-06-29 1:41 ` Zhong Li
2012-07-03 18:48 ` Christoph Lameter
2012-07-03 20:36 ` Christoph Lameter
2012-07-04 9:00 ` Li Zhong
2012-07-04 12:40 ` Glauber Costa
2012-07-05 1:41 ` Li Zhong
2012-07-05 8:23 ` Glauber Costa
2012-07-05 9:29 ` Li Zhong
2012-07-06 10:13 ` Glauber Costa
2012-07-09 1:48 ` Li Zhong [this message]
2012-06-25 10:54 ` [PATCH SLUB 1/2] duplicate the cache name in saved_alias list Wanlong Gao
2012-06-26 2:49 ` Li Zhong
2012-06-25 11:10 ` Glauber Costa
2012-06-26 2:58 ` Li Zhong
2012-06-27 7:53 ` [PATCH SLUB 1/2 v2] " 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=1341798533.2439.13.camel@ThinkPad-T420 \
--to=zhong@linux.vnet.ibm.com \
--cc=cl@linux.com \
--cc=glommer@parallels.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).