From: Frederic Weisbecker Both syscalls need to iterate through the thread group to get the cputimes. As some threads of the group may be running on nohz cpuset, we need to flush the cputimes there. Signed-off-by: Frederic Weisbecker Cc: Alessio Igor Bogani Cc: Andrew Morton Cc: Avi Kivity Cc: Chris Metcalf Cc: Christoph Lameter Cc: Daniel Lezcano Cc: Geoff Levand Cc: Gilad Ben Yossef Cc: Hakan Akkan Cc: Ingo Molnar Cc: Kevin Hilman Cc: Max Krasnyansky Cc: Paul E. McKenney Cc: Peter Zijlstra Cc: Stephen Hemminger Cc: Steven Rostedt Cc: Sven-Thorsten Dietrich Cc: Thomas Gleixner --- kernel/sys.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kernel/sys.c b/kernel/sys.c index e6e0ece..b57ea9a 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -47,6 +47,7 @@ #include #include #include +#include #include /* Move somewhere else to avoid recompiling? */ @@ -1045,6 +1046,8 @@ void do_sys_times(struct tms *tms) { cputime_t tgutime, tgstime, cutime, cstime; + cpuset_nohz_flush_cputimes(); + spin_lock_irq(¤t->sighand->siglock); thread_group_times(current, &tgutime, &tgstime); cutime = current->signal->cutime; @@ -1710,6 +1713,9 @@ static void k_getrusage(struct task_struct *p, int who, struct rusage *r) goto out; } + /* For thread_group_times */ + cpuset_nohz_flush_cputimes(); + if (!lock_task_sighand(p, &flags)) return; -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/