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

Michael Ellerman michael at ellerman.id.au
Fri Aug 10 10:19:05 EST 2007


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 ..

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/20070810/9c8e1ce7/attachment.pgp>


More information about the cbe-oss-dev mailing list