diff options
Diffstat (limited to 'arch/powerpc/platforms/cell/spufs/sched.c')
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/sched.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c index e929e70a84e3..34654743363d 100644 --- a/arch/powerpc/platforms/cell/spufs/sched.c +++ b/arch/powerpc/platforms/cell/spufs/sched.c | |||
@@ -899,7 +899,8 @@ static noinline void spusched_tick(struct spu_context *ctx) | |||
899 | spu_add_to_rq(ctx); | 899 | spu_add_to_rq(ctx); |
900 | } else { | 900 | } else { |
901 | spu_context_nospu_trace(spusched_tick__newslice, ctx); | 901 | spu_context_nospu_trace(spusched_tick__newslice, ctx); |
902 | ctx->time_slice++; | 902 | if (!ctx->time_slice) |
903 | ctx->time_slice++; | ||
903 | } | 904 | } |
904 | out: | 905 | out: |
905 | spu_release(ctx); | 906 | spu_release(ctx); |
@@ -993,6 +994,7 @@ void spuctx_switch_state(struct spu_context *ctx, | |||
993 | struct timespec ts; | 994 | struct timespec ts; |
994 | struct spu *spu; | 995 | struct spu *spu; |
995 | enum spu_utilization_state old_state; | 996 | enum spu_utilization_state old_state; |
997 | int node; | ||
996 | 998 | ||
997 | ktime_get_ts(&ts); | 999 | ktime_get_ts(&ts); |
998 | curtime = timespec_to_ns(&ts); | 1000 | curtime = timespec_to_ns(&ts); |
@@ -1014,6 +1016,11 @@ void spuctx_switch_state(struct spu_context *ctx, | |||
1014 | spu->stats.times[old_state] += delta; | 1016 | spu->stats.times[old_state] += delta; |
1015 | spu->stats.util_state = new_state; | 1017 | spu->stats.util_state = new_state; |
1016 | spu->stats.tstamp = curtime; | 1018 | spu->stats.tstamp = curtime; |
1019 | node = spu->node; | ||
1020 | if (old_state == SPU_UTIL_USER) | ||
1021 | atomic_dec(&cbe_spu_info[node].busy_spus); | ||
1022 | if (new_state == SPU_UTIL_USER); | ||
1023 | atomic_inc(&cbe_spu_info[node].busy_spus); | ||
1017 | } | 1024 | } |
1018 | } | 1025 | } |
1019 | 1026 | ||