From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751851AbdBAKGt (ORCPT ); Wed, 1 Feb 2017 05:06:49 -0500 Received: from terminus.zytor.com ([65.50.211.136]:55758 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751513AbdBAKGs (ORCPT ); Wed, 1 Feb 2017 05:06:48 -0500 Date: Wed, 1 Feb 2017 02:05:49 -0800 From: tip-bot for Frederic Weisbecker Message-ID: Cc: mingo@kernel.org, sgruszka@redhat.com, riel@redhat.com, tglx@linutronix.de, fweisbec@gmail.com, paulus@samba.org, tony.luck@intel.com, torvalds@linux-foundation.org, wanpeng.li@hotmail.com, benh@kernel.crashing.org, schwidefsky@de.ibm.com, hpa@zytor.com, fenghua.yu@intel.com, heiko.carstens@de.ibm.com, peterz@infradead.org, linux-kernel@vger.kernel.org, mpe@ellerman.id.au Reply-To: peterz@infradead.org, linux-kernel@vger.kernel.org, mpe@ellerman.id.au, fenghua.yu@intel.com, heiko.carstens@de.ibm.com, benh@kernel.crashing.org, schwidefsky@de.ibm.com, hpa@zytor.com, wanpeng.li@hotmail.com, torvalds@linux-foundation.org, fweisbec@gmail.com, paulus@samba.org, tony.luck@intel.com, mingo@kernel.org, sgruszka@redhat.com, riel@redhat.com, tglx@linutronix.de In-Reply-To: <1485832191-26889-32-git-send-email-fweisbec@gmail.com> References: <1485832191-26889-32-git-send-email-fweisbec@gmail.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/core] s390, sched/cputime: Make arch_cpu_idle_time() to return nsecs Git-Commit-ID: 42b425b3360a20ed08e0d735623f389bdf5e4500 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 42b425b3360a20ed08e0d735623f389bdf5e4500 Gitweb: http://git.kernel.org/tip/42b425b3360a20ed08e0d735623f389bdf5e4500 Author: Frederic Weisbecker AuthorDate: Tue, 31 Jan 2017 04:09:47 +0100 Committer: Ingo Molnar CommitDate: Wed, 1 Feb 2017 09:14:03 +0100 s390, sched/cputime: Make arch_cpu_idle_time() to return nsecs This way we don't need to deal with cputime_t details from the core code. Signed-off-by: Frederic Weisbecker Cc: Benjamin Herrenschmidt Cc: Fenghua Yu Cc: Heiko Carstens Cc: Linus Torvalds Cc: Martin Schwidefsky Cc: Michael Ellerman Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Rik van Riel Cc: Stanislaw Gruszka Cc: Thomas Gleixner Cc: Tony Luck Cc: Wanpeng Li Link: http://lkml.kernel.org/r/1485832191-26889-32-git-send-email-fweisbec@gmail.com Signed-off-by: Ingo Molnar --- arch/s390/include/asm/cputime.h | 2 +- arch/s390/kernel/idle.c | 5 +++-- fs/proc/stat.c | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/arch/s390/include/asm/cputime.h b/arch/s390/include/asm/cputime.h index 221b454..9a94481 100644 --- a/arch/s390/include/asm/cputime.h +++ b/arch/s390/include/asm/cputime.h @@ -141,7 +141,7 @@ static inline clock_t cputime64_to_clock_t(cputime64_t cputime) return clock; } -cputime64_t arch_cpu_idle_time(int cpu); +u64 arch_cpu_idle_time(int cpu); #define arch_idle_time(cpu) arch_cpu_idle_time(cpu) diff --git a/arch/s390/kernel/idle.c b/arch/s390/kernel/idle.c index 5c0e08e7..d3bf69e 100644 --- a/arch/s390/kernel/idle.c +++ b/arch/s390/kernel/idle.c @@ -84,7 +84,7 @@ static ssize_t show_idle_time(struct device *dev, } DEVICE_ATTR(idle_time_us, 0444, show_idle_time, NULL); -cputime64_t arch_cpu_idle_time(int cpu) +u64 arch_cpu_idle_time(int cpu) { struct s390_idle_data *idle = &per_cpu(s390_idle, cpu); unsigned long long now, idle_enter, idle_exit; @@ -96,7 +96,8 @@ cputime64_t arch_cpu_idle_time(int cpu) idle_enter = ACCESS_ONCE(idle->clock_idle_enter); idle_exit = ACCESS_ONCE(idle->clock_idle_exit); } while (read_seqcount_retry(&idle->seqcount, seq)); - return idle_enter ? ((idle_exit ?: now) - idle_enter) : 0; + + return cputime_to_nsecs(idle_enter ? ((idle_exit ?: now) - idle_enter) : 0); } void arch_cpu_idle_enter(void) diff --git a/fs/proc/stat.c b/fs/proc/stat.c index 44475a4..e47c3e8 100644 --- a/fs/proc/stat.c +++ b/fs/proc/stat.c @@ -27,7 +27,7 @@ static u64 get_idle_time(int cpu) idle = kcpustat_cpu(cpu).cpustat[CPUTIME_IDLE]; if (cpu_online(cpu) && !nr_iowait_cpu(cpu)) - idle += cputime_to_nsecs(arch_idle_time(cpu)); + idle += arch_idle_time(cpu); return idle; } @@ -37,7 +37,7 @@ static u64 get_iowait_time(int cpu) iowait = kcpustat_cpu(cpu).cpustat[CPUTIME_IOWAIT]; if (cpu_online(cpu) && nr_iowait_cpu(cpu)) - iowait += cputime_to_nsecs(arch_idle_time(cpu)); + iowait += arch_idle_time(cpu); return iowait; }