linux/arch/powerpc/platforms/cell/spufs
Jeremy Kerr b65fe0356b powerpc/spufs: Fix race for a free SPU
We currently have a race for a free SPE. With one thread doing a
spu_yield(), and another doing a spu_activate():

thread 1				thread 2
spu_yield(oldctx)			spu_activate(ctx)
  __spu_deactivate(oldctx)
  spu_unschedule(oldctx, spu)
  spu->alloc_state = SPU_FREE
					spu = spu_get_idle(ctx)
					    - searches for a SPE in
					      state SPU_FREE, gets
					      the context just
					      freed by thread 1
					spu_schedule(ctx, spu)
					  spu->alloc_state = SPU_USED
spu_schedule(newctx, spu)
  - assumes spu is still free
  - tries to schedule context on
    already-used spu

This change introduces a 'free_spu' flag to spu_unschedule, to indicate
whether or not the function should free the spu after descheduling the
context. We only set this flag if we're not going to re-schedule
another context on this SPU.

Add a comment to document this behaviour.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
2008-09-05 10:52:03 +10:00
..
.gitignore [POWERPC] spufs: add .gitignore for spu_save_dump.h & spu_restore_dump.h 2008-04-30 16:29:30 +10:00
backing_ops.c [POWERPC] spufs: Update SPU_Status[CISHP] in backing runcntl write 2008-02-08 19:52:35 +11:00
context.c powerpc/spufs: avoid magic numbers for mapping sizes 2008-07-09 10:13:40 +10:00
coredump.c [PATCH] split linux/file.h 2008-05-01 13:08:16 -04:00
fault.c [POWERPC] spufs: fix concurrent delivery of class 0 & 1 exceptions 2008-05-05 13:33:44 +10:00
file.c spufs: use new vm_ops->access to allow local state access from gdb 2008-07-24 10:47:15 -07:00
gang.c
hw_ops.c [POWERPC] spufs: use #defines for SPU class [012] exception status 2007-12-21 19:46:20 +11:00
inode.c SL*B: drop kmem cache argument from constructor 2008-07-26 12:00:07 -07:00
lscsa_alloc.c [POWERPC] spufs: move fault, lscsa_alloc and switch code to spufs module 2007-12-21 19:46:19 +11:00
Makefile [POWERPC] spufs: Add marker-based tracing facility 2008-02-06 16:26:59 +11:00
run.c powerpc/spufs: fix npc setting for NOSCHED contexts 2008-08-13 11:42:47 +10:00
sched.c powerpc/spufs: Fix race for a free SPU 2008-09-05 10:52:03 +10:00
spu_restore_crt0.S
spu_restore_dump.h_shipped
spu_restore.c
spu_save_crt0.S
spu_save_dump.h_shipped
spu_save.c
spu_utils.h
spufs.h powerpc/spufs: only add ".ctx" file with "debug" mount option 2008-07-09 10:13:41 +10:00
sputrace.c powerpc/spufs: correct kcalloc usage 2008-07-23 09:37:16 +10:00
switch.c [POWERPC] spufs: handle faults while the context switch pending flag is set 2008-05-05 13:33:44 +10:00
syscalls.c Introduce path_put() 2008-02-14 21:13:33 -08:00