diff options
author | Christoph Hellwig <hch@lst.de> | 2007-07-20 21:39:54 +0200 |
---|---|---|
committer | Arnd Bergmann <arnd@klappe.arndb.de> | 2007-07-20 21:42:28 +0200 |
commit | 486acd4850dde6d2f8c7f431432f3914c4bfb5f5 (patch) | |
tree | 610d93bad54ca3626a55ae78c9cde4a302aecc45 /include/asm-powerpc | |
parent | 1474855d0878cced6f39f51f3c2bd7428b44cb1e (diff) | |
download | op-kernel-dev-486acd4850dde6d2f8c7f431432f3914c4bfb5f5.zip op-kernel-dev-486acd4850dde6d2f8c7f431432f3914c4bfb5f5.tar.gz |
[CELL] spufs: rework list management and associated locking
This sorts out the various lists and related locks in the spu code.
In detail:
- the per-node free_spus and active_list are gone. Instead struct spu
gained an alloc_state member telling whether the spu is free or not
- the per-node spus array is now locked by a per-node mutex, which
takes over from the global spu_lock and the per-node active_mutex
- the spu_alloc* and spu_free function are gone as the state change is
now done inline in the spufs code. This allows some more sharing of
code for the affinity vs normal case and more efficient locking
- some little refactoring in the affinity code for this locking scheme
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
Diffstat (limited to 'include/asm-powerpc')
-rw-r--r-- | include/asm-powerpc/spu.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/include/asm-powerpc/spu.h b/include/asm-powerpc/spu.h index a0f7fc8..8836c0f 100644 --- a/include/asm-powerpc/spu.h +++ b/include/asm-powerpc/spu.h @@ -121,10 +121,9 @@ struct spu { unsigned long problem_phys; struct spu_problem __iomem *problem; struct spu_priv2 __iomem *priv2; - struct list_head list; struct list_head cbe_list; - struct list_head sched_list; struct list_head full_list; + enum { SPU_FREE, SPU_USED } alloc_state; int number; unsigned int irqs[3]; u32 node; @@ -187,18 +186,16 @@ struct spu { }; struct cbe_spu_info { + struct mutex list_mutex; struct list_head spus; - struct list_head free_spus; int n_spus; + int nr_active; atomic_t reserved_spus; }; extern struct cbe_spu_info cbe_spu_info[]; -struct spu *spu_alloc(void); -struct spu *spu_alloc_node(int node); -struct spu *spu_alloc_spu(struct spu *spu); -void spu_free(struct spu *spu); +void spu_init_channels(struct spu *spu); int spu_irq_class_0_bottom(struct spu *spu); int spu_irq_class_1_bottom(struct spu *spu); void spu_irq_setaffinity(struct spu *spu, int cpu); |