[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1009141221310.31857@router.home>
Date: Tue, 14 Sep 2010 12:26:05 -0500 (CDT)
From: Christoph Lameter <cl@...ux.com>
To: Pekka Enberg <penberg@...nel.org>
cc: torvalds@...ux-founation.org, linux-kernel@...r.kernel.org,
David Rientjes <rientjes@...gle.com>
Subject: Re: [PATCH 1/2] SLUB: Fix merged slab cache names
On Tue, 14 Sep 2010, Pekka Enberg wrote:
> diff --git a/include/linux/slab.h b/include/linux/slab.h
> index 59260e2..df201cf 100644
> --- a/include/linux/slab.h
> +++ b/include/linux/slab.h
> @@ -76,6 +76,8 @@
> # define SLAB_FAILSLAB 0x00000000UL
> #endif
>
> +#define SLAB_DYNAMIC_NAME 0x04000000UL /* s->name is kmalloc()'d */
> +
Put this into mm/slub.c as slub only flag? What is the difference from
refcount == 1?
> @@ -3218,6 +3221,18 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size,
> down_write(&slub_lock);
> s = find_mergeable(size, align, flags, name, ctor);
> if (s) {
> + if (!(s->flags & SLAB_DYNAMIC_NAME)) {
> + const char *new_name;
> +
> + new_name = kstrdup(s->name, GFP_KERNEL);
Ok. Keeping the original name. Why dont we do strdup by default and always
do a kfree(s->name) on close?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists