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:	Mon, 14 Jul 2008 14:44:57 +1000
From:	Nick Piggin <nickpiggin@...oo.com.au>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Jon Tollefson <kniht@...ux.vnet.ibm.com>,
	Alexey Dobriyan <adobriyan@...il.com>, penberg@...helsinki.fi,
	mpm@...enic.com, linux-mm@...ck.org, linux-kernel@...r.kernel.org,
	cl@...ux-foundation.org
Subject: Re: SL*B: drop kmem cache argument from constructor

On Saturday 12 July 2008 05:22, Andrew Morton wrote:
> On Thu, 10 Jul 2008 11:44:16 -0500 Jon Tollefson <kniht@...ux.vnet.ibm.com> 
wrote:
> > Alexey Dobriyan wrote:
> > > Kmem cache passed to constructor is only needed for constructors that
> > > are themselves multiplexeres. Nobody uses this "feature", nor does
> > > anybody uses passed kmem cache in non-trivial way, so pass only pointer
> > > to object.
> > >
> > > Non-trivial places are:
> > > 	arch/powerpc/mm/init_64.c
> > > 	arch/powerpc/mm/hugetlbpage.c
> >
> > ...<snip>...
> >
> > > --- a/arch/powerpc/mm/hugetlbpage.c
> > > +++ b/arch/powerpc/mm/hugetlbpage.c
> > > @@ -595,9 +595,9 @@ static int __init hugepage_setup_sz(char *str)
> > >  }
> > >  __setup("hugepagesz=", hugepage_setup_sz);
> > >
> > > -static void zero_ctor(struct kmem_cache *cache, void *addr)
> > > +static void zero_ctor(void *addr)
> > >  {
> > > -	memset(addr, 0, kmem_cache_size(cache));
> > > +	memset(addr, 0, HUGEPTE_TABLE_SIZE);
> >
> > This isn't going to work with the multiple huge page size support.  The
> > HUGEPTE_TABLE_SIZE macro now takes a parameter with of the mmu psize
> > index to indicate the size of page.
>
> hrm.  I suppose we could hold our noses and use ksize(), assuming that
> we're ready to use ksize() at this stage in the object's lifetime.
>
> Better would be to just use kmem_cache_zalloc()?

As this is hugepages we're talking about, probably yes. But note that
page tables are one of those things where we (I?) think constructors are
probably a good idea -- they tend to be very sparse.
--
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