Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753887AbbFXPAI (ORCPT ); Wed, 24 Jun 2015 11:00:08 -0400 Received: from shelob.surriel.com ([74.92.59.67]:32787 "EHLO shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753066AbbFXO6K (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 10/11] nohz,kvm,time: skip vtime accounting at kernel entry & exit Date: Wed, 24 Jun 2015 10:57:59 -0400 Message-Id: <1435157880-22925-11-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: 2163 Lines: 66 From: Rik van Riel When timer statistics are sampled from a remote CPU, vtime calculations at the kernel/user and kernel/guest boundary are no longer necessary. Skip them. Signed-off-by: Rik van Riel --- include/linux/context_tracking.h | 4 ++-- kernel/context_tracking.c | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/linux/context_tracking.h b/include/linux/context_tracking.h index d7ee7eb9e0bc..e3e7c674543f 100644 --- a/include/linux/context_tracking.h +++ b/include/linux/context_tracking.h @@ -90,7 +90,7 @@ static inline void context_tracking_init(void) { } #ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN static inline void guest_enter(void) { - if (tick_accounting_disabled()) + if (tick_accounting_disabled() && !tick_accounting_remote()) vtime_guest_enter(current); else current->flags |= PF_VCPU; @@ -104,7 +104,7 @@ static inline void guest_exit(void) if (context_tracking_is_enabled()) __context_tracking_exit(CONTEXT_GUEST); - if (tick_accounting_disabled()) + if (tick_accounting_disabled() && !tick_accounting_remote()) vtime_guest_exit(current); else current->flags &= ~PF_VCPU; diff --git a/kernel/context_tracking.c b/kernel/context_tracking.c index 6da4205c3184..a58cbed13ebd 100644 --- a/kernel/context_tracking.c +++ b/kernel/context_tracking.c @@ -63,7 +63,8 @@ void __context_tracking_enter(enum ctx_state state) */ if (state == CONTEXT_USER) { trace_user_enter(0); - vtime_user_enter(current); + if (!tick_accounting_remote()) + vtime_user_enter(current); } rcu_user_enter(); } @@ -135,7 +136,8 @@ void __context_tracking_exit(enum ctx_state state) */ rcu_user_exit(); if (state == CONTEXT_USER) { - vtime_user_exit(current); + if (!tick_accounting_remote()) + vtime_user_exit(current); trace_user_exit(0); } } -- 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/