|
@@ -611,7 +611,6 @@ static int __init create_spu(void *data)
|
|
|
int ret;
|
|
|
static int number;
|
|
|
unsigned long flags;
|
|
|
- struct timespec ts;
|
|
|
|
|
|
ret = -ENOMEM;
|
|
|
spu = kzalloc(sizeof (*spu), GFP_KERNEL);
|
|
@@ -652,8 +651,7 @@ static int __init create_spu(void *data)
|
|
|
mutex_unlock(&spu_full_list_mutex);
|
|
|
|
|
|
spu->stats.util_state = SPU_UTIL_IDLE_LOADED;
|
|
|
- ktime_get_ts(&ts);
|
|
|
- spu->stats.tstamp = timespec_to_ns(&ts);
|
|
|
+ spu->stats.tstamp = ktime_get_ns();
|
|
|
|
|
|
INIT_LIST_HEAD(&spu->aff_list);
|
|
|
|
|
@@ -676,7 +674,6 @@ static const char *spu_state_names[] = {
|
|
|
static unsigned long long spu_acct_time(struct spu *spu,
|
|
|
enum spu_utilization_state state)
|
|
|
{
|
|
|
- struct timespec ts;
|
|
|
unsigned long long time = spu->stats.times[state];
|
|
|
|
|
|
/*
|
|
@@ -684,10 +681,8 @@ static unsigned long long spu_acct_time(struct spu *spu,
|
|
|
* statistics are not updated. Apply the time delta from the
|
|
|
* last recorded state of the spu.
|
|
|
*/
|
|
|
- if (spu->stats.util_state == state) {
|
|
|
- ktime_get_ts(&ts);
|
|
|
- time += timespec_to_ns(&ts) - spu->stats.tstamp;
|
|
|
- }
|
|
|
+ if (spu->stats.util_state == state)
|
|
|
+ time += ktime_get_ns() - spu->stats.tstamp;
|
|
|
|
|
|
return time / NSEC_PER_MSEC;
|
|
|
}
|