Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b192541b authored by Luke Browning's avatar Luke Browning Committed by Paul Mackerras
Browse files

[POWERPC] spufs: spu_find_victim may choose wrong victim



Need to re-check priority after dropping lock.  Otherwise, a
more favored context may be preempted.

Signed-off-by: default avatarLuke Browning <lukebr@linux.vnet.ibm.com>
Signed-off-by: default avatarJeremy Kerr <jk@ozlabs.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 91569531
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -626,10 +626,10 @@ static struct spu *find_victim(struct spu_context *ctx)
			}

			spu = victim->spu;
			if (!spu) {
			if (!spu || victim->prio <= ctx->prio) {
				/*
				 * This race can happen because we've dropped
				 * the active list mutex.  No a problem, just
				 * the active list mutex.  Not a problem, just
				 * restart the search.
				 */
				mutex_unlock(&victim->state_mutex);