diff options
-rw-r--r-- | arch/powerpc/platforms/cell/spu_base.c | 11 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/context.c | 4 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/file.c | 4 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/sched.c | 4 |
4 files changed, 6 insertions, 17 deletions
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c index f85db3a69b4a..2930d1e81a05 100644 --- a/arch/powerpc/platforms/cell/spu_base.c +++ b/arch/powerpc/platforms/cell/spu_base.c | |||
@@ -611,7 +611,6 @@ static int __init create_spu(void *data) | |||
611 | int ret; | 611 | int ret; |
612 | static int number; | 612 | static int number; |
613 | unsigned long flags; | 613 | unsigned long flags; |
614 | struct timespec ts; | ||
615 | 614 | ||
616 | ret = -ENOMEM; | 615 | ret = -ENOMEM; |
617 | spu = kzalloc(sizeof (*spu), GFP_KERNEL); | 616 | spu = kzalloc(sizeof (*spu), GFP_KERNEL); |
@@ -652,8 +651,7 @@ static int __init create_spu(void *data) | |||
652 | mutex_unlock(&spu_full_list_mutex); | 651 | mutex_unlock(&spu_full_list_mutex); |
653 | 652 | ||
654 | spu->stats.util_state = SPU_UTIL_IDLE_LOADED; | 653 | spu->stats.util_state = SPU_UTIL_IDLE_LOADED; |
655 | ktime_get_ts(&ts); | 654 | spu->stats.tstamp = ktime_get_ns(); |
656 | spu->stats.tstamp = timespec_to_ns(&ts); | ||
657 | 655 | ||
658 | INIT_LIST_HEAD(&spu->aff_list); | 656 | INIT_LIST_HEAD(&spu->aff_list); |
659 | 657 | ||
@@ -676,7 +674,6 @@ static const char *spu_state_names[] = { | |||
676 | static unsigned long long spu_acct_time(struct spu *spu, | 674 | static unsigned long long spu_acct_time(struct spu *spu, |
677 | enum spu_utilization_state state) | 675 | enum spu_utilization_state state) |
678 | { | 676 | { |
679 | struct timespec ts; | ||
680 | unsigned long long time = spu->stats.times[state]; | 677 | unsigned long long time = spu->stats.times[state]; |
681 | 678 | ||
682 | /* | 679 | /* |
@@ -684,10 +681,8 @@ static unsigned long long spu_acct_time(struct spu *spu, | |||
684 | * statistics are not updated. Apply the time delta from the | 681 | * statistics are not updated. Apply the time delta from the |
685 | * last recorded state of the spu. | 682 | * last recorded state of the spu. |
686 | */ | 683 | */ |
687 | if (spu->stats.util_state == state) { | 684 | if (spu->stats.util_state == state) |
688 | ktime_get_ts(&ts); | 685 | time += ktime_get_ns() - spu->stats.tstamp; |
689 | time += timespec_to_ns(&ts) - spu->stats.tstamp; | ||
690 | } | ||
691 | 686 | ||
692 | return time / NSEC_PER_MSEC; | 687 | return time / NSEC_PER_MSEC; |
693 | } | 688 | } |
diff --git a/arch/powerpc/platforms/cell/spufs/context.c b/arch/powerpc/platforms/cell/spufs/context.c index 9c6790d17eda..3b4152faeb1f 100644 --- a/arch/powerpc/platforms/cell/spufs/context.c +++ b/arch/powerpc/platforms/cell/spufs/context.c | |||
@@ -36,7 +36,6 @@ atomic_t nr_spu_contexts = ATOMIC_INIT(0); | |||
36 | struct spu_context *alloc_spu_context(struct spu_gang *gang) | 36 | struct spu_context *alloc_spu_context(struct spu_gang *gang) |
37 | { | 37 | { |
38 | struct spu_context *ctx; | 38 | struct spu_context *ctx; |
39 | struct timespec ts; | ||
40 | 39 | ||
41 | ctx = kzalloc(sizeof *ctx, GFP_KERNEL); | 40 | ctx = kzalloc(sizeof *ctx, GFP_KERNEL); |
42 | if (!ctx) | 41 | if (!ctx) |
@@ -67,8 +66,7 @@ struct spu_context *alloc_spu_context(struct spu_gang *gang) | |||
67 | __spu_update_sched_info(ctx); | 66 | __spu_update_sched_info(ctx); |
68 | spu_set_timeslice(ctx); | 67 | spu_set_timeslice(ctx); |
69 | ctx->stats.util_state = SPU_UTIL_IDLE_LOADED; | 68 | ctx->stats.util_state = SPU_UTIL_IDLE_LOADED; |
70 | ktime_get_ts(&ts); | 69 | ctx->stats.tstamp = ktime_get_ns(); |
71 | ctx->stats.tstamp = timespec_to_ns(&ts); | ||
72 | 70 | ||
73 | atomic_inc(&nr_spu_contexts); | 71 | atomic_inc(&nr_spu_contexts); |
74 | goto out; | 72 | goto out; |
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c index 90986923a53a..d966bbe58b8f 100644 --- a/arch/powerpc/platforms/cell/spufs/file.c +++ b/arch/powerpc/platforms/cell/spufs/file.c | |||
@@ -2338,7 +2338,6 @@ static const char *ctx_state_names[] = { | |||
2338 | static unsigned long long spufs_acct_time(struct spu_context *ctx, | 2338 | static unsigned long long spufs_acct_time(struct spu_context *ctx, |
2339 | enum spu_utilization_state state) | 2339 | enum spu_utilization_state state) |
2340 | { | 2340 | { |
2341 | struct timespec ts; | ||
2342 | unsigned long long time = ctx->stats.times[state]; | 2341 | unsigned long long time = ctx->stats.times[state]; |
2343 | 2342 | ||
2344 | /* | 2343 | /* |
@@ -2351,8 +2350,7 @@ static unsigned long long spufs_acct_time(struct spu_context *ctx, | |||
2351 | * of the spu context. | 2350 | * of the spu context. |
2352 | */ | 2351 | */ |
2353 | if (ctx->spu && ctx->stats.util_state == state) { | 2352 | if (ctx->spu && ctx->stats.util_state == state) { |
2354 | ktime_get_ts(&ts); | 2353 | time += ktime_get_ns() - ctx->stats.tstamp; |
2355 | time += timespec_to_ns(&ts) - ctx->stats.tstamp; | ||
2356 | } | 2354 | } |
2357 | 2355 | ||
2358 | return time / NSEC_PER_MSEC; | 2356 | return time / NSEC_PER_MSEC; |
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c index 4a0a64fe25df..998f632e7cce 100644 --- a/arch/powerpc/platforms/cell/spufs/sched.c +++ b/arch/powerpc/platforms/cell/spufs/sched.c | |||
@@ -1039,13 +1039,11 @@ void spuctx_switch_state(struct spu_context *ctx, | |||
1039 | { | 1039 | { |
1040 | unsigned long long curtime; | 1040 | unsigned long long curtime; |
1041 | signed long long delta; | 1041 | signed long long delta; |
1042 | struct timespec ts; | ||
1043 | struct spu *spu; | 1042 | struct spu *spu; |
1044 | enum spu_utilization_state old_state; | 1043 | enum spu_utilization_state old_state; |
1045 | int node; | 1044 | int node; |
1046 | 1045 | ||
1047 | ktime_get_ts(&ts); | 1046 | curtime = ktime_get_ns(); |
1048 | curtime = timespec_to_ns(&ts); | ||
1049 | delta = curtime - ctx->stats.tstamp; | 1047 | delta = curtime - ctx->stats.tstamp; |
1050 | 1048 | ||
1051 | WARN_ON(!mutex_is_locked(&ctx->state_mutex)); | 1049 | WARN_ON(!mutex_is_locked(&ctx->state_mutex)); |