From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752004AbdANKDC (ORCPT ); Sat, 14 Jan 2017 05:03:02 -0500 Received: from terminus.zytor.com ([198.137.202.10]:47524 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751955AbdANKC6 (ORCPT ); Sat, 14 Jan 2017 05:02:58 -0500 Date: Sat, 14 Jan 2017 02:01:59 -0800 From: tip-bot for Frederic Weisbecker Message-ID: Cc: heiko.carstens@de.ibm.com, hpa@zytor.com, torvalds@linux-foundation.org, borntraeger@de.ibm.com, fenghua.yu@intel.com, mingo@kernel.org, peterz@infradead.org, tony.luck@intel.com, fweisbec@gmail.com, tglx@linutronix.de, mpe@ellerman.id.au, riel@redhat.com, sgruszka@redhat.com, schwidefsky@de.ibm.com, paulus@samba.org, wanpeng.li@hotmail.com, linux-kernel@vger.kernel.org, benh@kernel.crashing.org Reply-To: benh@kernel.crashing.org, linux-kernel@vger.kernel.org, wanpeng.li@hotmail.com, paulus@samba.org, schwidefsky@de.ibm.com, riel@redhat.com, sgruszka@redhat.com, mpe@ellerman.id.au, fweisbec@gmail.com, tglx@linutronix.de, tony.luck@intel.com, fenghua.yu@intel.com, mingo@kernel.org, peterz@infradead.org, hpa@zytor.com, borntraeger@de.ibm.com, torvalds@linux-foundation.org, heiko.carstens@de.ibm.com In-Reply-To: <1483636310-6557-5-git-send-email-fweisbec@gmail.com> References: <1483636310-6557-5-git-send-email-fweisbec@gmail.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/core] sched/cputime: Export account_guest_time() Git-Commit-ID: 1213699ab426608ff1925ab263dd6925102bb92a 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: 1213699ab426608ff1925ab263dd6925102bb92a Gitweb: http://git.kernel.org/tip/1213699ab426608ff1925ab263dd6925102bb92a Author: Frederic Weisbecker AuthorDate: Thu, 5 Jan 2017 18:11:44 +0100 Committer: Ingo Molnar CommitDate: Sat, 14 Jan 2017 09:54:11 +0100 sched/cputime: Export account_guest_time() In order to prepare for CONFIG_VIRT_CPU_ACCOUNTING_NATIVE=y to delay cputime accounting to the tick, let's allow archs to account cputime directly to gtime. Signed-off-by: Frederic Weisbecker Acked-by: Thomas Gleixner Cc: Benjamin Herrenschmidt Cc: Christian Borntraeger 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: Tony Luck Cc: Wanpeng Li Link: http://lkml.kernel.org/r/1483636310-6557-5-git-send-email-fweisbec@gmail.com Signed-off-by: Ingo Molnar --- include/linux/kernel_stat.h | 1 + kernel/sched/cputime.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h index 14b63bb..cfd6c0c 100644 --- a/include/linux/kernel_stat.h +++ b/include/linux/kernel_stat.h @@ -79,6 +79,7 @@ static inline unsigned int kstat_cpu_irqs_sum(unsigned int cpu) } extern void account_user_time(struct task_struct *, cputime_t); +extern void account_guest_time(struct task_struct *, cputime_t); extern void account_system_time(struct task_struct *, int, cputime_t); extern void account_system_index_time(struct task_struct *, cputime_t, enum cpu_usage_stat); diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c index aad4283..5813ee4 100644 --- a/kernel/sched/cputime.c +++ b/kernel/sched/cputime.c @@ -151,7 +151,7 @@ void account_user_time(struct task_struct *p, cputime_t cputime) * @p: the process that the cpu time gets accounted to * @cputime: the cpu time spent in virtual machine since the last update */ -static void account_guest_time(struct task_struct *p, cputime_t cputime) +void account_guest_time(struct task_struct *p, cputime_t cputime) { u64 *cpustat = kcpustat_this_cpu->cpustat;