Skip to content
Commit 0111a701 authored by Jeremy Kerr's avatar Jeremy Kerr
Browse files

[POWERPC] spufs: fix invalid scheduling of forgotten contexts



At present, we have a situation where a context with no owner is
re-scheduled by spu_forget:

	Thread 1: reading regs file	Thread 2: context owner

					spu_forget()
						- ctx->owner = NULL
						- set SPU_SCHED_WAS_ACTIVE

	spu_acquire_saved()
	- context is in saved state

	spu_release_saved()
	- SPU_SCHED_WAS_ACTIVE is set,
	  so spu_activate() the context,
	  which now has no owner

In spu_forget(), we shouldn't be requesting a re-schedule by setting
SPU_SCHED_WAS_ACTIVE. This change removes the set_bit in spu_forget(),
so that spu_release_saved() doesn't reinsert this destroyed context on
to the run queue.

Signed-off-by: default avatarJeremy Kerr <jk@ozlabs.org>
parent d5883137
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment