aboutsummaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2008-09-04 15:02:47 +1000
committerJeremy Kerr <jk@ozlabs.org>2008-09-05 10:52:03 +1000
commitb65fe0356b5b732d7e1e0224c6a1cf2eb5255984 (patch)
treea5b1e1e16695c6335cdcb51aa2a4a0d47b2b690a /usr
parent9f43e3914dceb0f8191875b3cdf4325b48d0d70a (diff)
downloadkernel_samsung_smdk4412-b65fe0356b5b732d7e1e0224c6a1cf2eb5255984.zip
kernel_samsung_smdk4412-b65fe0356b5b732d7e1e0224c6a1cf2eb5255984.tar.gz
kernel_samsung_smdk4412-b65fe0356b5b732d7e1e0224c6a1cf2eb5255984.tar.bz2
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>
Diffstat (limited to 'usr')
0 files changed, 0 insertions, 0 deletions