From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S970984AbdAERND (ORCPT ); Thu, 5 Jan 2017 12:13:03 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:35188 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1763042AbdAERMD (ORCPT ); Thu, 5 Jan 2017 12:12:03 -0500 From: Frederic Weisbecker To: LKML Cc: Frederic Weisbecker , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Heiko Carstens , Martin Schwidefsky , Tony Luck , Fenghua Yu , Peter Zijlstra , Rik van Riel , Thomas Gleixner , Ingo Molnar , Stanislaw Gruszka , Wanpeng Li , Christian Borntraeger Subject: [PATCH 04/10] cputime: Export account_guest_time Date: Thu, 5 Jan 2017 18:11:44 +0100 Message-Id: <1483636310-6557-5-git-send-email-fweisbec@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1483636310-6557-1-git-send-email-fweisbec@gmail.com> References: <1483636310-6557-1-git-send-email-fweisbec@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In order to prepare for CONFIG_VIRT_CPU_ACCOUNTING_NATIVE to delay cputime accounting to the tick, let's allow archs to account cputime directly to gtime. Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman Cc: Heiko Carstens Cc: Martin Schwidefsky Cc: Tony Luck Cc: Fenghua Yu Cc: Peter Zijlstra Cc: Rik van Riel Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Stanislaw Gruszka Cc: Wanpeng Li Cc: Christian Borntraeger Signed-off-by: Frederic Weisbecker --- 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; -- 2.7.4