[Cbe-oss-dev] [rfc/patch 2/3] SPUFS: move spu_ctx allocation into the slab allocator

Michael Ellerman michael at ellerman.id.au
Thu Aug 16 16:53:38 EST 2007


On Sat, 2007-08-11 at 05:53 +0200, Christoph Hellwig wrote:
> On Fri, Aug 10, 2007 at 10:19:05AM +1000, Michael Ellerman wrote:
> > On Thu, 2007-08-09 at 13:59 +0200, Sebastian Siewior wrote:
> > > plain text document attachment (spufs_add_kmem_for_spectx.diff)
> > > spufs_conntext is about 2880 bytes and is a ressource that gets often allocated
> > > and freed again. It might be good to use the slab allocator for it.
> > > 
> > > Signed-off-by: Sebastian Siewior <sebastian at breakpoint.cc>
> > > --- a/arch/powerpc/platforms/cell/spufs/context.c
> > > +++ b/arch/powerpc/platforms/cell/spufs/context.c
> > > @@ -29,13 +29,12 @@
> > >  #include <asm/spu_csa.h>
> > >  #include "spufs.h"
> > >  
> > > -
> > >  atomic_t nr_spu_contexts = ATOMIC_INIT(0);
> > >  
> > >  struct spu_context *alloc_spu_context(struct spu_gang *gang)
> > >  {
> > >  	struct spu_context *ctx;
> > > -	ctx = kzalloc(sizeof *ctx, GFP_KERNEL);
> > > +	ctx = kmem_cache_zalloc(spufs_ctx_cache, GFP_KERNEL);
> > 
> > Random thought, should we allocate it on the node we're going to run on?
> > Although we may don't know yet which node it is yet ..
> 
> We don't know it at all here and with a loaded system a context could
> change the node it's running on quite a few times.   We don't allocate
> task structs on the node the process is going to be running on (first)
> either.

Sure, just thinking out loud. It would be nice if NOSCHED contexts were
allocated on the same node the ctx lands on, though whether it would
make any noticable performance impact is debatable.

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/cbe-oss-dev/attachments/20070816/ca1ab453/attachment.pgp>


More information about the cbe-oss-dev mailing list