[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0706191222420.7008@schroedinger.engr.sgi.com>
Date: Tue, 19 Jun 2007 12:24:33 -0700 (PDT)
From: Christoph Lameter <clameter@....com>
To: Andrew Morton <akpm@...ux-foundation.org>
cc: Cedric Le Goater <clg@...ibm.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Herbert Poetzl <herbert@...hfloor.at>,
Pavel Emelianov <xemul@...nvz.org>
Subject: Re: [PATCH -mm] add a kmem_cache for nsproxy objects
On Tue, 19 Jun 2007, Andrew Morton wrote:
> On Mon, 18 Jun 2007 22:53:13 +0200
> Cedric Le Goater <clg@...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.
Powered by blists - more mailing lists