aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/misc/uid_cputime.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/misc/uid_cputime.c b/drivers/misc/uid_cputime.c
index ad32727..73ed8b2 100644
--- a/drivers/misc/uid_cputime.c
+++ b/drivers/misc/uid_cputime.c
@@ -101,6 +101,10 @@ static int uid_stat_show(struct seq_file *m, void *v)
__func__, task_uid(task));
return -ENOMEM;
}
+ /* if this task is exiting, we have already accounted for the
+ * time and power. */
+ if (task->cpu_power == ULLONG_MAX)
+ continue;
task_times(task, &utime, &stime);
uid_entry->active_utime += utime;
uid_entry->active_stime += stime;
@@ -212,6 +216,7 @@ static int process_notifier(struct notifier_block *self,
uid_entry->utime += utime;
uid_entry->stime += stime;
uid_entry->power += task->cpu_power;
+ task->cpu_power = ULLONG_MAX;
exit:
mutex_unlock(&uid_lock);