From: Pekka Enberg <penberg@kernel.org>
To: Christoph Lameter <cl@linux.com>
Cc: torvalds@linux-founation.org, linux-kernel@vger.kernel.org,
David Rientjes <rientjes@google.com>
Subject: Re: [PATCH 1/2] SLUB: Fix merged slab cache names
Date: Tue, 14 Sep 2010 20:36:44 +0300 [thread overview]
Message-ID: <4C8FB2AC.1030107@kernel.org> (raw)
In-Reply-To: <alpine.DEB.2.00.1009141221310.31857@router.home>
On 14.9.2010 20.26, Christoph Lameter wrote:
> 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?
I can put it in mm/slub.c but I was worried about someone reusing the
bit for something else.
Do you mean refcount == 2? You don't know during kmem cache release time
if someone was merged to the cache or not.
>> @@ -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?
>
I tried that. It gets very nasty during bootstrap.
next prev parent reply other threads:[~2010-09-14 17:36 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-14 17:06 [PATCH 1/2] SLUB: Fix merged slab cache names Pekka Enberg
2010-09-14 17:06 ` [PATCH 2/2] SLUB: Mark merged slab caches in /proc/slabinfo Pekka Enberg
2010-09-14 17:10 ` Pekka Enberg
2010-09-14 17:28 ` Christoph Lameter
2010-09-14 17:59 ` Pekka Enberg
2010-09-14 18:05 ` Linus Torvalds
2010-09-14 18:47 ` Pekka Enberg
2010-09-14 17:26 ` [PATCH 1/2] SLUB: Fix merged slab cache names Christoph Lameter
2010-09-14 17:36 ` Pekka Enberg [this message]
2010-09-14 17:47 ` Christoph Lameter
2010-09-14 17:49 ` Pekka Enberg
2010-09-14 17:59 ` Christoph Lameter
2010-09-14 18:02 ` Linus Torvalds
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=4C8FB2AC.1030107@kernel.org \
--to=penberg@kernel.org \
--cc=cl@linux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rientjes@google.com \
--cc=torvalds@linux-founation.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