From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031100Ab2CUOAQ (ORCPT ); Wed, 21 Mar 2012 10:00:16 -0400 Received: from mail-we0-f174.google.com ([74.125.82.174]:61813 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031101Ab2CUOAI (ORCPT ); Wed, 21 Mar 2012 10:00:08 -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 , Ingo Molnar , Max Krasnyansky , "Paul E. McKenney" , Peter Zijlstra , Stephen Hemminger , Steven Rostedt , Sven-Thorsten Dietrich , Thomas Gleixner , Zen Lin Subject: [PATCH 23/32] nohz/cpuset: Flush cputimes for getrusage() and times() syscalls Date: Wed, 21 Mar 2012 14:58:29 +0100 Message-Id: <1332338318-5958-25-git-send-email-fweisbec@gmail.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1332338318-5958-1-git-send-email-fweisbec@gmail.com> References: <1332338318-5958-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: Ingo Molnar Cc: Max Krasnyansky Cc: Paul E. McKenney Cc: Peter Zijlstra Cc: Stephen Hemminger Cc: Steven Rostedt Cc: Sven-Thorsten Dietrich Cc: Thomas Gleixner Cc: Zen Lin --- 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