diff options
| -rw-r--r-- | arch/powerpc/platforms/cell/spufs/sched.c | 6 | ||||
| -rw-r--r-- | include/asm-powerpc/spu.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c index afb92d4fbcf5..34654743363d 100644 --- a/arch/powerpc/platforms/cell/spufs/sched.c +++ b/arch/powerpc/platforms/cell/spufs/sched.c | |||
| @@ -994,6 +994,7 @@ void spuctx_switch_state(struct spu_context *ctx, | |||
| 994 | struct timespec ts; | 994 | struct timespec ts; |
| 995 | struct spu *spu; | 995 | struct spu *spu; |
| 996 | enum spu_utilization_state old_state; | 996 | enum spu_utilization_state old_state; |
| 997 | int node; | ||
| 997 | 998 | ||
| 998 | ktime_get_ts(&ts); | 999 | ktime_get_ts(&ts); |
| 999 | curtime = timespec_to_ns(&ts); | 1000 | curtime = timespec_to_ns(&ts); |
| @@ -1015,6 +1016,11 @@ void spuctx_switch_state(struct spu_context *ctx, | |||
| 1015 | spu->stats.times[old_state] += delta; | 1016 | spu->stats.times[old_state] += delta; |
| 1016 | spu->stats.util_state = new_state; | 1017 | spu->stats.util_state = new_state; |
| 1017 | 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); | ||
| 1018 | } | 1024 | } |
| 1019 | } | 1025 | } |
| 1020 | 1026 | ||
diff --git a/include/asm-powerpc/spu.h b/include/asm-powerpc/spu.h index 99348c1f4cab..8b2eb044270a 100644 --- a/include/asm-powerpc/spu.h +++ b/include/asm-powerpc/spu.h | |||
| @@ -191,6 +191,7 @@ struct cbe_spu_info { | |||
| 191 | struct list_head spus; | 191 | struct list_head spus; |
| 192 | int n_spus; | 192 | int n_spus; |
| 193 | int nr_active; | 193 | int nr_active; |
| 194 | atomic_t busy_spus; | ||
| 194 | atomic_t reserved_spus; | 195 | atomic_t reserved_spus; |
| 195 | }; | 196 | }; |
| 196 | 197 | ||
