From patchwork Thu Feb 5 16:35:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rik van Riel X-Patchwork-Id: 5785671 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2F361BF440 for ; Thu, 5 Feb 2015 16:55:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6403A201BB for ; Thu, 5 Feb 2015 16:55:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7CD3920166 for ; Thu, 5 Feb 2015 16:55:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757665AbbBEQzG (ORCPT ); Thu, 5 Feb 2015 11:55:06 -0500 Received: from shelob.surriel.com ([74.92.59.67]:43729 "EHLO shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753854AbbBEQzE (ORCPT ); Thu, 5 Feb 2015 11:55:04 -0500 X-Greylist: delayed 1163 seconds by postgrey-1.27 at vger.kernel.org; Thu, 05 Feb 2015 11:55:04 EST Received: from [2002:4a5c:3b41:1:224:e8ff:fe38:995c] (helo=annuminas.surriel.com) by shelob.surriel.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1YJPOz-0000pQ-FE; Thu, 05 Feb 2015 11:35:37 -0500 Received: from annuminas.surriel.com (localhost.localdomain [127.0.0.1]) by annuminas.surriel.com (8.14.8/8.14.5) with ESMTP id t15GZbIs017834; Thu, 5 Feb 2015 11:35:37 -0500 Received: (from riel@localhost) by annuminas.surriel.com (8.14.8/8.14.8/Submit) id t15GZbxt017833; Thu, 5 Feb 2015 11:35:37 -0500 X-Authentication-Warning: annuminas.surriel.com: riel set sender to riel@redhat.com using -f From: riel@redhat.com To: kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, mtosatti@redhat.com, mingo@kernel.org, ak@linux.intel.com, oleg@redhat.com, masami.hiramatsu.pt@hitachi.com, fweisbec@gmail.com, paulmck@linux.vnet.ibm.com, lcapitulino@redhat.com, pbonzini@redhat.com Subject: [PATCH 2/4] rcu, nohz: run vtime_user_enter/exit only when state == IN_USER Date: Thu, 5 Feb 2015 11:35:32 -0500 Message-Id: <1423154134-17391-3-git-send-email-riel@redhat.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1423154134-17391-1-git-send-email-riel@redhat.com> References: <1423154134-17391-1-git-send-email-riel@redhat.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Rik van Riel Only run vtime_user_enter and vtime_user_exit when we are entering or exiting user state, respectively. The RCU code only distinguishes between "idle" and "not idle or kernel". There should be no need to add an additional (unused) state there. Signed-off-by: Rik van Riel --- kernel/context_tracking.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kernel/context_tracking.c b/kernel/context_tracking.c index 4c010787c9ec..97806c4deec5 100644 --- a/kernel/context_tracking.c +++ b/kernel/context_tracking.c @@ -85,7 +85,8 @@ void context_tracking_user_enter(enum ctx_state state) * user_exit() or rcu_irq_enter(). Let's remove RCU's dependency * on the tick. */ - vtime_user_enter(current); + if (state == IN_USER) + vtime_user_enter(current); rcu_user_enter(); } /* @@ -136,7 +137,8 @@ void context_tracking_user_exit(enum ctx_state state) * RCU core about that (ie: we may need the tick again). */ rcu_user_exit(); - vtime_user_exit(current); + if (state == IN_USER) + vtime_user_exit(current); trace_user_exit(0); } __this_cpu_write(context_tracking.state, IN_KERNEL);