diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2012-11-13 08:20:55 -0500 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2013-01-27 13:23:31 -0500 |
commit | 6fac4829ce0ef9b7f24369086ce5f0e9f38d37bc (patch) | |
tree | 44da712b66d778c2fd701f9c96b00e108530e1a9 /kernel/cpu.c | |
parent | 3f4724ea85b7d9055a9976fa8f30b471bdfbca93 (diff) |
cputime: Use accessors to read task cputime stats
This is in preparation for the full dynticks feature. While
remotely reading the cputime of a task running in a full
dynticks CPU, we'll need to do some extra-computation. This
way we can account the time it spent tickless in userspace
since its last cputime snapshot.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Li Zhong <zhong@linux.vnet.ibm.com>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/cpu.c')
-rw-r--r-- | kernel/cpu.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c index 3046a503242c..e5d5e8e1e030 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c | |||
@@ -224,11 +224,13 @@ void clear_tasks_mm_cpumask(int cpu) | |||
224 | static inline void check_for_tasks(int cpu) | 224 | static inline void check_for_tasks(int cpu) |
225 | { | 225 | { |
226 | struct task_struct *p; | 226 | struct task_struct *p; |
227 | cputime_t utime, stime; | ||
227 | 228 | ||
228 | write_lock_irq(&tasklist_lock); | 229 | write_lock_irq(&tasklist_lock); |
229 | for_each_process(p) { | 230 | for_each_process(p) { |
231 | task_cputime(p, &utime, &stime); | ||
230 | if (task_cpu(p) == cpu && p->state == TASK_RUNNING && | 232 | if (task_cpu(p) == cpu && p->state == TASK_RUNNING && |
231 | (p->utime || p->stime)) | 233 | (utime || stime)) |
232 | printk(KERN_WARNING "Task %s (pid = %d) is on cpu %d " | 234 | printk(KERN_WARNING "Task %s (pid = %d) is on cpu %d " |
233 | "(state = %ld, flags = %x)\n", | 235 | "(state = %ld, flags = %x)\n", |
234 | p->comm, task_pid_nr(p), cpu, | 236 | p->comm, task_pid_nr(p), cpu, |