From patchwork Fri Jan 4 02:58:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srivatsa Vaddagiri X-Patchwork-Id: 209365 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id F392A2C05A5 for ; Fri, 4 Jan 2013 15:37:03 +1100 (EST) Received: from wolverine01.qualcomm.com (wolverine01.qualcomm.com [199.106.114.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "wolverine01.qualcomm.com", Issuer "VeriSign Class 3 Secure Server CA" (not verified)) by ozlabs.org (Postfix) with ESMTPS id C0CCD2C008E for ; Fri, 4 Jan 2013 14:08:57 +1100 (EST) X-IronPort-AV: E=Sophos;i="4.84,406,1355126400"; d="scan'208";a="17669351" Received: from pdmz-ns-snip_115_219.qualcomm.com (HELO mostmsg01.qualcomm.com) ([199.106.115.219]) by wolverine01.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 03 Jan 2013 18:59:00 -0800 Received: from svaddagi-linux.qualcomm.com (pdmz-ns-snip_218_1.qualcomm.com [192.168.218.1]) by mostmsg01.qualcomm.com (Postfix) with ESMTPA id C8F7610004DC; Thu, 3 Jan 2013 18:58:59 -0800 (PST) From: Srivatsa Vaddagiri To: Russell King , "Paul E. McKenney" , Stephen Boyd , linux-arm-kernel@lists.infradead.org, Mike Frysinger , uclinux-dist-devel@blackfin.uclinux.org, Ralf Baechle , linux-mips@linux-mips.org, Benjamin Herrenschmidt , linuxppc-dev@lists.ozlabs.org, Martin Schwidefsky , linux-s390@vger.kernel.org, Paul Mundt , linux-sh@vger.kernel.org, "David S. Miller" , sparclinux@vger.kernel.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, mhocko@suse.cz, srivatsa.bhat@linux.vnet.ibm.com Subject: [PATCH 2/2] Revert "nohz: Fix idle ticks in cpu summary line of /proc/stat" (commit 7386cdbf2f57ea8cff3c9fde93f206e58b9fe13f). Date: Thu, 3 Jan 2013 18:58:57 -0800 Message-Id: <1357268337-8025-1-git-send-email-vatsa@codeaurora.org> X-Mailer: git-send-email 1.7.8.3 X-Mailman-Approved-At: Fri, 04 Jan 2013 15:35:38 +1100 Cc: linux-arm-msm@vger.kernel.org, Srivatsa Vaddagiri , linux-kernel@vger.kernel.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" With offline cpus no longer beeing seen in nohz mode (ts->idle_active=0), we don't need the check for cpu_online() introduced in commit 7386cdbf. Offline cpu's idle time as last recorded in its ts->idle_sleeptime will be reported (thus excluding its offline time as part of idle time statistics). Cc: mhocko@suse.cz Cc: srivatsa.bhat@linux.vnet.ibm.com Signed-off-by: Srivatsa Vaddagiri --- fs/proc/stat.c | 14 ++++---------- 1 files changed, 4 insertions(+), 10 deletions(-) diff --git a/fs/proc/stat.c b/fs/proc/stat.c index e296572..64c3b31 100644 --- a/fs/proc/stat.c +++ b/fs/proc/stat.c @@ -45,13 +45,10 @@ static cputime64_t get_iowait_time(int cpu) static u64 get_idle_time(int cpu) { - u64 idle, idle_time = -1ULL; - - if (cpu_online(cpu)) - idle_time = get_cpu_idle_time_us(cpu, NULL); + u64 idle, idle_time = get_cpu_idle_time_us(cpu, NULL); if (idle_time == -1ULL) - /* !NO_HZ or cpu offline so we can rely on cpustat.idle */ + /* !NO_HZ so we can rely on cpustat.idle */ idle = kcpustat_cpu(cpu).cpustat[CPUTIME_IDLE]; else idle = usecs_to_cputime64(idle_time); @@ -61,13 +58,10 @@ static u64 get_idle_time(int cpu) static u64 get_iowait_time(int cpu) { - u64 iowait, iowait_time = -1ULL; - - if (cpu_online(cpu)) - iowait_time = get_cpu_iowait_time_us(cpu, NULL); + u64 iowait, iowait_time = get_cpu_iowait_time_us(cpu, NULL); if (iowait_time == -1ULL) - /* !NO_HZ or cpu offline so we can rely on cpustat.iowait */ + /* !NO_HZ so we can rely on cpustat.iowait */ iowait = kcpustat_cpu(cpu).cpustat[CPUTIME_IOWAIT]; else iowait = usecs_to_cputime64(iowait_time);