Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753855AbbFXO7w (ORCPT ); Wed, 24 Jun 2015 10:59:52 -0400 Received: from shelob.surriel.com ([74.92.59.67]:32799 "EHLO shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753092AbbFXO6K (ORCPT ); Wed, 24 Jun 2015 10:58:10 -0400 From: riel@redhat.com To: linux-kernel@vger.kernel.org Cc: fweisbec@redhat.com, peterz@infradead.org, mingo@kernel.org, tglx@linutronix.de, luto@amacapital.net Subject: [RFC PATCH 04/11] time,nohz: add cpu parameter to steal_account_process_tick Date: Wed, 24 Jun 2015 10:57:53 -0400 Message-Id: <1435157880-22925-5-git-send-email-riel@redhat.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1435157880-22925-1-git-send-email-riel@redhat.com> References: <1435157880-22925-1-git-send-email-riel@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2169 Lines: 68 From: Rik van Riel Add a cpu parameter to steal_account_process_tick, so it can be used to do CPU time accounting for another CPU. Signed-off-by: Rik van Riel --- kernel/sched/cputime.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c index 7df761cd6dfc..9717d86cf2ab 100644 --- a/kernel/sched/cputime.c +++ b/kernel/sched/cputime.c @@ -254,15 +254,15 @@ void account_idle_time(cputime_t cputime) cpustat[CPUTIME_IDLE] += (__force u64) cputime; } -static __always_inline bool steal_account_process_tick(void) +static __always_inline bool steal_account_process_tick(int cpu) { #ifdef CONFIG_PARAVIRT if (static_key_false(¶virt_steal_enabled)) { u64 steal; cputime_t steal_ct; - steal = paravirt_steal_clock(smp_processor_id()); - steal -= this_rq()->prev_steal_time; + steal = paravirt_steal_clock(cpu); + steal -= cpu_rq(cpu)->prev_steal_time; /* * cputime_t may be less precise than nsecs (eg: if it's @@ -270,7 +270,7 @@ static __always_inline bool steal_account_process_tick(void) * granularity and account the rest on the next rounds. */ steal_ct = nsecs_to_cputime(steal); - this_rq()->prev_steal_time += cputime_to_nsecs(steal_ct); + cpu_rq(cpu)->prev_steal_time += cputime_to_nsecs(steal_ct); account_steal_time(steal_ct); return steal_ct; @@ -345,7 +345,7 @@ static void irqtime_account_process_tick(struct task_struct *p, int cpu, u64 cputime = (__force u64) cputime_one_jiffy; u64 *cpustat = kstat->cpustat; - if (steal_account_process_tick()) + if (steal_account_process_tick(cpu)) return; cputime *= ticks; @@ -483,7 +483,7 @@ void account_process_tick(struct task_struct *p, int user_tick) return; } - if (steal_account_process_tick()) + if (steal_account_process_tick(cpu)) return; if (user_tick) -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/