From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932181Ab2EAAD6 (ORCPT ); Mon, 30 Apr 2012 20:03:58 -0400 Received: from mail-qa0-f46.google.com ([209.85.216.46]:41691 "EHLO mail-qa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932077Ab2EAADz (ORCPT ); Mon, 30 Apr 2012 20:03:55 -0400 From: Frederic Weisbecker To: LKML , linaro-sched-sig@lists.linaro.org Cc: Frederic Weisbecker , Alessio Igor Bogani , Andrew Morton , Avi Kivity , Chris Metcalf , Christoph Lameter , Daniel Lezcano , Geoff Levand , Gilad Ben Yossef , Hakan Akkan , Ingo Molnar , Kevin Hilman , Max Krasnyansky , "Paul E. McKenney" , Peter Zijlstra , Stephen Hemminger , Steven Rostedt , Sven-Thorsten Dietrich , Thomas Gleixner Subject: [PATCH 23/41] nohz/cpuset: Flush cputimes for getrusage() and times() syscalls Date: Tue, 1 May 2012 01:54:57 +0200 Message-Id: <1335830115-14335-24-git-send-email-fweisbec@gmail.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1335830115-14335-1-git-send-email-fweisbec@gmail.com> References: <1335830115-14335-1-git-send-email-fweisbec@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 files changed, 6 insertions(+), 0 deletions(-) diff --git a/kernel/sys.c b/kernel/sys.c index 4070153..5b3e880 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -45,6 +45,7 @@ #include #include #include +#include #include /* Move somewhere else to avoid recompiling? */ @@ -950,6 +951,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; @@ -1614,6 +1617,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.5.4