From: Cedric Le Goater <clg@fr.ibm.com>
To: Christoph Lameter <clameter@sgi.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Herbert Poetzl <herbert@13thfloor.at>,
Pavel Emelianov <xemul@openvz.org>
Subject: Re: [PATCH -mm] add a kmem_cache for nsproxy objects
Date: Fri, 22 Jun 2007 09:48:06 +0200 [thread overview]
Message-ID: <467B7EB6.4050207@fr.ibm.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0706191222420.7008@schroedinger.engr.sgi.com>
Christoph Lameter wrote:
> On Tue, 19 Jun 2007, Andrew Morton wrote:
>
>> On Mon, 18 Jun 2007 22:53:13 +0200
>> Cedric Le Goater <clg@fr.ibm.com> wrote:
>>
>>> +static int __init nsproxy_cache_init(void)
>>> +{
>>> + nsproxy_cachep = kmem_cache_create("nsproxy", sizeof(struct nsproxy),
>>> + 0, SLAB_PANIC, NULL, NULL);
>>> + return 0;
>>> +}
>>> +
>> Christoph added this cheesy KMEM_CACHE macro. But I don't immediately recall
>> the rationale so I'm a bit reluctant to ask people to use-the-cheesy-macro.
>>
>> Perhaps he can remind us why it is there?
>
> Because it simplifies the handling of slabs.
>
> The above will could become:
>
> nsproxy_cachep = KMEM_CACHE(nsproxy, SLAB_PANIC);
>
> meaning create a cache for the nsproxy struct, the nsproxy name and the
> nsproxy size. See include/linux/slab.h.
yes, I should probably use that for the nsproxy struct.
my 2cts :
the macro sets the align parameter to "__alignof__(struct)" by default.
is that something we want to do all the time ? if so, why not change
kmem_cache_create() directly ?
Most of the complexity is in flags. I did a grep and picked what i thought
was the most aggressive. The macro would probably be more useful if we could
identify by it's name in which context it can be used.
C.
next prev parent reply other threads:[~2007-06-22 7:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-18 20:53 [PATCH -mm] add a kmem_cache for nsproxy objects Cedric Le Goater
2007-06-19 18:35 ` Andrew Morton
2007-06-19 19:04 ` Christoph Hellwig
2007-06-19 19:27 ` Christoph Lameter
2007-06-19 21:14 ` Pekka Enberg
2007-06-19 19:24 ` Christoph Lameter
2007-06-22 7:48 ` Cedric Le Goater [this message]
2007-06-22 16:22 ` Christoph Lameter
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=467B7EB6.4050207@fr.ibm.com \
--to=clg@fr.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=clameter@sgi.com \
--cc=herbert@13thfloor.at \
--cc=linux-kernel@vger.kernel.org \
--cc=xemul@openvz.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