[Cbe-oss-dev] [rfc/patch 2/3] SPUFS: move spu_ctx allocation into the slab allocator
Christoph Hellwig
hch at lst.de
Sat Aug 11 13:53:46 EST 2007
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.
More information about the cbe-oss-dev
mailing list