Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 108903
b: refs/heads/master
c: 8d5636f
h: refs/heads/master
i:
  108901: f27c817
  108899: 224f70f
  108895: e31bf0b
v: v3
  • Loading branch information
Jeremy Kerr committed Aug 14, 2008
1 parent 29f4515 commit eb5eda3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d9dd421fd6ed17af55d27c8d93a9f561be0ff50f
refs/heads/master: 8d5636fbca202f61fdb808fc9e20c0142291d802
9 changes: 8 additions & 1 deletion trunk/arch/powerpc/platforms/cell/spufs/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -641,8 +641,10 @@ static struct spu *find_victim(struct spu_context *ctx)

if (tmp && tmp->prio > ctx->prio &&
!(tmp->flags & SPU_CREATE_NOSCHED) &&
(!victim || tmp->prio > victim->prio))
(!victim || tmp->prio > victim->prio)) {
victim = spu->ctx;
get_spu_context(victim);
}
}
mutex_unlock(&cbe_spu_info[node].list_mutex);

Expand All @@ -658,6 +660,7 @@ static struct spu *find_victim(struct spu_context *ctx)
* look at another context or give up after X retries.
*/
if (!mutex_trylock(&victim->state_mutex)) {
put_spu_context(victim);
victim = NULL;
goto restart;
}
Expand All @@ -670,6 +673,7 @@ static struct spu *find_victim(struct spu_context *ctx)
* restart the search.
*/
mutex_unlock(&victim->state_mutex);
put_spu_context(victim);
victim = NULL;
goto restart;
}
Expand All @@ -687,6 +691,7 @@ static struct spu *find_victim(struct spu_context *ctx)
spu_add_to_rq(victim);

mutex_unlock(&victim->state_mutex);
put_spu_context(victim);

return spu;
}
Expand Down Expand Up @@ -985,9 +990,11 @@ static int spusched_thread(void *unused)
struct spu_context *ctx = spu->ctx;

if (ctx) {
get_spu_context(ctx);
mutex_unlock(mtx);
spusched_tick(ctx);
mutex_lock(mtx);
put_spu_context(ctx);
}
}
mutex_unlock(mtx);
Expand Down

0 comments on commit eb5eda3

Please sign in to comment.