linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Nick Piggin <nickpiggin@yahoo.com.au>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Jon Tollefson <kniht@linux.vnet.ibm.com>,
	Alexey Dobriyan <adobriyan@gmail.com>,
	penberg@cs.helsinki.fi, mpm@selenic.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, cl@linux-foundation.org
Subject: Re: SL*B: drop kmem cache argument from constructor
Date: Mon, 14 Jul 2008 14:44:57 +1000	[thread overview]
Message-ID: <200807141444.57802.nickpiggin@yahoo.com.au> (raw)
In-Reply-To: <20080711122228.eb40247f.akpm@linux-foundation.org>

On Saturday 12 July 2008 05:22, Andrew Morton wrote:
> On Thu, 10 Jul 2008 11:44:16 -0500 Jon Tollefson <kniht@linux.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, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      parent reply	other threads:[~2008-07-14  4:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-10  1:11 Alexey Dobriyan
2008-07-10  7:13 ` Pekka Enberg
2008-07-10 13:24 ` Christoph Lameter
2008-07-10 16:44 ` Jon Tollefson
2008-07-11 19:22   ` Andrew Morton
2008-07-11 19:38     ` Matt Mackall
2008-07-11 21:40     ` Jon Tollefson
2008-07-14  4:48       ` Nick Piggin
2008-07-14  4:44     ` Nick Piggin [this message]

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=200807141444.57802.nickpiggin@yahoo.com.au \
    --to=nickpiggin@yahoo.com.au \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux-foundation.org \
    --cc=kniht@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mpm@selenic.com \
    --cc=penberg@cs.helsinki.fi \
    /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