提交 b192541b 编写于 作者: L Luke Browning 提交者: Paul Mackerras

[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: NLuke Browning <lukebr@linux.vnet.ibm.com>
Signed-off-by: NJeremy Kerr <jk@ozlabs.org>
Signed-off-by: NPaul Mackerras <paulus@samba.org>
上级 91569531
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册