From patchwork Thu Feb 5 20:23:49 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: 5786701 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 442539F336 for ; Thu, 5 Feb 2015 20:25:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 81832201FA for ; Thu, 5 Feb 2015 20:25:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A951C20274 for ; Thu, 5 Feb 2015 20:25:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753660AbbBEUX6 (ORCPT ); Thu, 5 Feb 2015 15:23:58 -0500 Received: from shelob.surriel.com ([74.92.59.67]:47356 "EHLO shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751383AbbBEUX4 (ORCPT ); Thu, 5 Feb 2015 15:23:56 -0500 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 1YJSxu-0003yR-6O; Thu, 05 Feb 2015 15:23:54 -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 t15KNsSH017735; Thu, 5 Feb 2015 15:23:54 -0500 Received: (from riel@localhost) by annuminas.surriel.com (8.14.8/8.14.8/Submit) id t15KNsNi017734; Thu, 5 Feb 2015 15:23:54 -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: borntraeger@de.ibm.com, linux-kernel@vger.kernel.org, mtosatti@redhat.com, mingo@kernel.orgm, 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/5] rcu, nohz: run vtime_user_enter/exit only when state == IN_USER Date: Thu, 5 Feb 2015 15:23:49 -0500 Message-Id: <1423167832-17609-3-git-send-email-riel@redhat.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1423167832-17609-1-git-send-email-riel@redhat.com> References: <1423167832-17609-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);