* [PATCH] Update the kmem_cache_create documentation regarding the name parameter
@ 2008-11-21 12:56 Catalin Marinas
2008-11-24 7:56 ` Pekka Enberg
0 siblings, 1 reply; 2+ messages in thread
From: Catalin Marinas @ 2008-11-21 12:56 UTC (permalink / raw)
To: linux-kernel; +Cc: Pekka Enberg
kmem_cache implementations like slub are allowed to merge multiple
caches but only the initial name is preserved. Therefore,
kmem_cache_name() is not guaranteed to return the same pointer passed to
the former function. This patch updates the documentation to make this
clearer.
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>
---
mm/slab.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/mm/slab.c b/mm/slab.c
index 4887f1b..8924a03 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -2124,6 +2124,8 @@ static int __init_refok setup_cpu_cache(struct kmem_cache *cachep)
*
* @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.
*
* The flags are
*
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Update the kmem_cache_create documentation regarding the name parameter
2008-11-21 12:56 [PATCH] Update the kmem_cache_create documentation regarding the name parameter Catalin Marinas
@ 2008-11-24 7:56 ` Pekka Enberg
0 siblings, 0 replies; 2+ messages in thread
From: Pekka Enberg @ 2008-11-24 7:56 UTC (permalink / raw)
To: Catalin Marinas; +Cc: linux-kernel, cl
Hi Catalin,
On Fri, 2008-11-21 at 12:56 +0000, Catalin Marinas wrote:
> kmem_cache implementations like slub are allowed to merge multiple
> caches but only the initial name is preserved. Therefore,
> kmem_cache_name() is not guaranteed to return the same pointer passed to
> the former function. This patch updates the documentation to make this
> clearer.
>
> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Pekka Enberg <penberg@cs.helsinki.fi>
Applied, thanks!
> ---
> mm/slab.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/mm/slab.c b/mm/slab.c
> index 4887f1b..8924a03 100644
> --- a/mm/slab.c
> +++ b/mm/slab.c
> @@ -2124,6 +2124,8 @@ static int __init_refok setup_cpu_cache(struct kmem_cache *cachep)
> *
> * @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.
> *
> * The flags are
> *
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-11-24 7:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-21 12:56 [PATCH] Update the kmem_cache_create documentation regarding the name parameter Catalin Marinas
2008-11-24 7:56 ` Pekka Enberg
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®