Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932065AbbFXO6c (ORCPT ); Wed, 24 Jun 2015 10:58:32 -0400 Received: from shelob.surriel.com ([74.92.59.67]:32791 "EHLO shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752285AbbFXO6K (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 11/11] nohz,kvm,time: teach account_process_tick about guest time Date: Wed, 24 Jun 2015 10:58:00 -0400 Message-Id: <1435157880-22925-12-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: 1193 Lines: 34 From: Rik van Riel When tick based accounting is run from a remote CPU, it is actually possible to encounter a task with PF_VCPU set. Make sure to account those as guest time. Signed-off-by: Rik van Riel --- kernel/sched/cputime.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c index 593f97b0fe3c..6295679fe5f5 100644 --- a/kernel/sched/cputime.c +++ b/kernel/sched/cputime.c @@ -488,7 +488,9 @@ void account_process_tick(struct task_struct *p, int user_tick) if (steal_account_process_tick(cpu)) return; - if (user_tick) + if (p->flags & PF_VCPU) + account_guest_time(p, cputime_one_jiffy, one_jiffy_scaled); + else if (user_tick) account_user_time(p, cputime_one_jiffy, one_jiffy_scaled); else if ((p != rq->idle) || (irq_count() != HARDIRQ_OFFSET)) account_system_time(p, HARDIRQ_OFFSET, cputime_one_jiffy, -- 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/