lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 22 Jun 2007 09:48:06 +0200
From:	Cedric Le Goater <clg@...ibm.com>
To:	Christoph Lameter <clameter@....com>
CC:	Andrew Morton <akpm@...ux-foundation.org>,
	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

Christoph Lameter wrote:
> 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.

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.

-
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ