[PATCH 17/32] nohz/cpuset: Flush cputimes on procfs stat file read

From: Steven Rostedt
Date: Mon Oct 29 2012 - 16:44:05 EST


From: Frederic Weisbecker <fweisbec@xxxxxxxxx>

When we read a process's procfs stat file, we need
to flush the cputimes of the tasks running in nohz
cpusets in case some childs in the thread group are
running there.

Signed-off-by: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Cc: Alessio Igor Bogani <abogani@xxxxxxxxxx>
Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Cc: Avi Kivity <avi@xxxxxxxxxx>
Cc: Chris Metcalf <cmetcalf@xxxxxxxxxx>
Cc: Christoph Lameter <cl@xxxxxxxxx>
Cc: Daniel Lezcano <daniel.lezcano@xxxxxxxxxx>
Cc: Geoff Levand <geoff@xxxxxxxxxxxxx>
Cc: Gilad Ben Yossef <gilad@xxxxxxxxxxxxx>
Cc: Hakan Akkan <hakanakkan@xxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Kevin Hilman <khilman@xxxxxx>
Cc: Max Krasnyansky <maxk@xxxxxxxxxxxx>
Cc: Paul E. McKenney <paulmck@xxxxxxxxxxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Stephen Hemminger <shemminger@xxxxxxxxxx>
Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>
Cc: Sven-Thorsten Dietrich <thebigcorporation@xxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
---
fs/proc/array.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/fs/proc/array.c b/fs/proc/array.c
index c1c207c..f7e1fdc 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -406,6 +406,8 @@ static int do_task_stat(struct seq_file *m, struct pid_namespace *ns,
cutime = cstime = utime = stime = 0;
cgtime = gtime = 0;

+ /* For thread group times */
+ cpuset_nohz_flush_cputimes();
if (lock_task_sighand(task, &flags)) {
struct signal_struct *sig = task->signal;

--
1.7.10.4


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/