diff options
author | Arnd Bergmann <arnd@arndb.de> | 2007-07-20 21:39:44 +0200 |
---|---|---|
committer | Arnd Bergmann <arnd@klappe.arndb.de> | 2007-07-20 21:42:11 +0200 |
commit | aa6d5b20254a21b69092dd839b70ee148303ef25 (patch) | |
tree | 0519330e2e4eb6360866dbf2104ed987e4bdd2c0 /arch/powerpc/platforms/cell/spufs/sched.c | |
parent | 7e90b74967ea54dbd6eb539e1cb151ec37f63d7f (diff) |
[CELL] cell: add per BE structure with info about its SPUs
Addition of a spufs-global "cbe_info" array. Each entry contains information
about one Cell/B.E. node, namelly:
* list of spus (both free and busy spus are in this list);
* list of free spus (replacing the static spu_list from spu_base.c)
* number of spus;
* number of reserved (non scheduleable) spus.
SPE affinity implementation actually requires only access to one spu per
BE node (since it implements its own pointer to walk through the other spus
of the ring) and the number of scheduleable spus (n_spus - non_sched_spus)
However having this more general structure can be useful for other
functionalities, concentrating per-cbe statistics / data.
Signed-off-by: Andre Detsch <adetsch@br.ibm.com>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Diffstat (limited to 'arch/powerpc/platforms/cell/spufs/sched.c')
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/sched.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c index 12c09665404d..6d0ab72cc70e 100644 --- a/arch/powerpc/platforms/cell/spufs/sched.c +++ b/arch/powerpc/platforms/cell/spufs/sched.c @@ -231,6 +231,9 @@ static void spu_bind_context(struct spu *spu, struct spu_context *ctx) spu->number, spu->node); spuctx_switch_state(ctx, SPU_UTIL_SYSTEM); + if (ctx->flags & SPU_CREATE_NOSCHED) + atomic_inc(&cbe_spu_info[spu->node].reserved_spus); + ctx->stats.slb_flt_base = spu->stats.slb_flt; ctx->stats.class2_intr_base = spu->stats.class2_intr; @@ -267,6 +270,8 @@ static void spu_unbind_context(struct spu *spu, struct spu_context *ctx) spu->pid, spu->number, spu->node); spuctx_switch_state(ctx, SPU_UTIL_SYSTEM); + if (spu->ctx->flags & SPU_CREATE_NOSCHED) + atomic_dec(&cbe_spu_info[spu->node].reserved_spus); spu_switch_notify(spu, NULL); spu_unmap_mappings(ctx); spu_save(&ctx->csa, spu); |