Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932072AbbFXO6n (ORCPT ); Wed, 24 Jun 2015 10:58:43 -0400 Received: from shelob.surriel.com ([74.92.59.67]:32795 "EHLO shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752964AbbFXO6K (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 01/11] nohz,time: make account_process_tick work on the task's CPU Date: Wed, 24 Jun 2015 10:57:50 -0400 Message-Id: <1435157880-22925-2-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: 1342 Lines: 40 From: Rik van Riel Teach account_process_tick to work on the CPU of the task specified in the function argument. This allows us to do remote tick based sampling of a nohz_full cpu from a housekeeping CPU. Signed-off-by: Rik van Riel --- kernel/sched/cputime.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c index 8394b1ee600c..97077c282626 100644 --- a/kernel/sched/cputime.c +++ b/kernel/sched/cputime.c @@ -463,8 +463,14 @@ void thread_group_cputime_adjusted(struct task_struct *p, cputime_t *ut, cputime void account_process_tick(struct task_struct *p, int user_tick) { cputime_t one_jiffy_scaled = cputime_to_scaled(cputime_one_jiffy); - struct rq *rq = this_rq(); + int cpu = task_cpu(p); + struct rq *rq = cpu_rq(cpu); + /* + * Tests current CPU, not "cpu", to see whether account_process_tick() + * should do work on this invocation, or whether time keeping for + * this CPU is done in some other way. + */ if (vtime_accounting_enabled()) return; -- 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/