From: "Pekka Enberg" <penberg@cs.helsinki.fi>
To: "Catalin Marinas" <catalin.marinas@arm.com>
Cc: "Christoph Lameter" <cl@linux-foundation.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
"Arnaldo Carvalho de Melo" <acme@ghostprotocols.net>
Subject: Re: Possible memory leak via slub kmem_cache_create
Date: Thu, 20 Nov 2008 20:45:19 +0200 [thread overview]
Message-ID: <84144f020811201045w27d4d751h771276eb5fd8beda@mail.gmail.com> (raw)
In-Reply-To: <1227174711.5784.9.camel@pc1117.cambridge.arm.com>
Hi Catalin,
On Thu, Nov 20, 2008 at 11:51 AM, Catalin Marinas
<catalin.marinas@arm.com> wrote:
> My point is that the API is slightly different when slub is used since
> kmem_cache_name is no longer guaranteed to return the same pointer
> passed to kmem_cache_create. Maybe a documentation update:
>
> diff --git a/mm/slab.c b/mm/slab.c
> index ea76bcb..9723a72 100644
> --- a/mm/slab.c
> +++ b/mm/slab.c
> @@ -2124,6 +2124,8 @@ static int __init_refok setup_cpu_cache(struct kmem_cache
> *
> * @name must be valid until the cache is destroyed. This implies that
> * the module calling this has to destroy the cache before getting unloaded.
> + * Note that kmem_cache_name() is not guaranteed to return the same pointer,
> + * therefore applications must manage it themselves.
Yes, makes sense. Care to send a patch I can apply?
Pekka
prev parent reply other threads:[~2008-11-20 18:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-19 16:25 Catalin Marinas
2008-11-19 19:22 ` Christoph Lameter
2008-11-20 9:51 ` Catalin Marinas
2008-11-20 11:04 ` Arnaldo Carvalho de Melo
2008-11-20 18:14 ` Christoph Lameter
2008-11-20 18:45 ` Pekka Enberg [this message]
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=84144f020811201045w27d4d751h771276eb5fd8beda@mail.gmail.com \
--to=penberg@cs.helsinki.fi \
--cc=acme@ghostprotocols.net \
--cc=catalin.marinas@arm.com \
--cc=cl@linux-foundation.org \
--cc=linux-kernel@vger.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
all inboxes | Powered by JetHome®