powerpc/spufs: Fix multiple get_spu_context()
Commit 8d5636fbca
introduced a reference
count on SPU contexts during find_victim, but this may cause a leak in
the reference count if we later find a better contender for a context to
unschedule.
Change the reference to after we've found our victim context, so we
don't do the extra get_spu_context().
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
This commit is contained in:
Родитель
7888bc2b47
Коммит
9f43e3914d
|
@ -643,9 +643,10 @@ static struct spu *find_victim(struct spu_context *ctx)
|
||||||
!(tmp->flags & SPU_CREATE_NOSCHED) &&
|
!(tmp->flags & SPU_CREATE_NOSCHED) &&
|
||||||
(!victim || tmp->prio > victim->prio)) {
|
(!victim || tmp->prio > victim->prio)) {
|
||||||
victim = spu->ctx;
|
victim = spu->ctx;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (victim)
|
||||||
get_spu_context(victim);
|
get_spu_context(victim);
|
||||||
}
|
|
||||||
}
|
|
||||||
mutex_unlock(&cbe_spu_info[node].list_mutex);
|
mutex_unlock(&cbe_spu_info[node].list_mutex);
|
||||||
|
|
||||||
if (victim) {
|
if (victim) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче