Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1208299pxb; Thu, 4 Mar 2021 06:11:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJw//vfz7dQT2Gd9PVIApNWU9odDzt9QwbE5JJgJthV3DpCbRkPs/0lv+MtB1PydZQWegFG7 X-Received: by 2002:adf:e5c4:: with SMTP id a4mr4292443wrn.174.1614867116794; Thu, 04 Mar 2021 06:11:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614867116; cv=none; d=google.com; s=arc-20160816; b=gAJqJ3bBwNPAQbXO0jsUgJ/R5ey4lM7iv/m2hzQ1w9zG5Dwz3WX0z31i/xg6EaOCBa o7Cm9g0VMyrk2YMTZJkMoH09944JHHRTHY9/SJVNsVOv4iyBt0xvtbbClGtdu9mHZYX7 LG0vesFDz59ofU/CJCqf1pNL45Rxkkm2hCUOG5+ULVlk0UOgu1hdAXksUmJixDr78QCc a4PzBKCJS7EvIikq5ugar/Rzk/Vqz5GKZAb6GCD/nFur6yjPZhV1F7fiDEsfrHQC57FY /iyzFo3A/2Rv0/D/jpHs8tMqfFsMLFI215QKOPwiPJlRcnxrdefpxiQYftWSmcMMK19K EONA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=goqBo2SKaDqmO3gKHK3yGi9QIV+hZJWFJ/IHH/hD+uQ=; b=DbJD3EutQIrYYyYurDx9Oht7vVEdPFXNKxkE/8Ac7cUODbbuw2umANSEMJZm3Q831R sQa9aFPfEWlTO96z8jRuKZbIMyxeGWUKLKRd8xDVo7PiUhhl4RDZXKJgIJCiXkvfMY6n /LEjdDBBoKkBiZgj4t8HpRBqmwPA2xTrC4qEsWQwixtIpaLxIQRJtAFCQw1QaJFGVMEo PNzInVMOOZ6fgkznmkwfRfKla94cuQomKiBcelz2C359B7oiW+A2jdxLPXbeFFKYhfNx 0hD+9UapzIyeKEImGeAWxNrg4ZDAXKJATt7zwyOxyYVsQOUu9qo9AYij82wyxIBhsHLt W6Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KqoBXGZF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f11si2513193ejw.277.2021.03.04.06.11.33; Thu, 04 Mar 2021 06:11:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KqoBXGZF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236828AbhCDBDl (ORCPT + 99 others); Wed, 3 Mar 2021 20:03:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:48842 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1448499AbhCDAZz (ORCPT ); Wed, 3 Mar 2021 19:25:55 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2492564EF4; Thu, 4 Mar 2021 00:23:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614817396; bh=OiSaEiNkEhwRX2z/bYu15I/KCOQQY7pPfHiI87nRh5s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KqoBXGZFZcvVm5nUWsuf+KavqK2fgwNlDhaCOFkBWWlrdGwFNCMUXhAi2ektg6t4G nKUXFqyV5ZSHY6JGZhlJRKgFy0MmMU49fv6juC147JsI8ipYOrm7mL6sLjdt2WIoHv LC7X/lylenFTQcK7gXtBvjqCqtjHSoBYT3AgGnKBYS9sdWifcUmDTgNTZ0sjx8RRqK h0g04kS4U6IB9i62Bsb+6TNzpbDEDOwvsmb5XG74AFW8RYZ3Mx1MNvg6qRS7Wi9HJk 94BTqekGcn2HfnCt5HZVz6tg/ikNP7uXFJvsmsh8CsR3fnR3WKdUP5xdXqxRWkI851 H1FK0hSHaj3lQ== From: paulmck@kernel.org To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, mingo@kernel.org, jiangshanlai@gmail.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, fweisbec@gmail.com, oleg@redhat.com, joel@joelfernandes.org, Frederic Weisbecker , Neeraj Upadhyay , Boqun Feng , "Paul E . McKenney" Subject: [PATCH tip/core/rcu 12/12] rcu/nocb: Move trace_rcu_nocb_wake() calls outside nocb_lock when possible Date: Wed, 3 Mar 2021 16:23:11 -0800 Message-Id: <20210304002311.23655-12-paulmck@kernel.org> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20210304002225.GA23492@paulmck-ThinkPad-P72> References: <20210304002225.GA23492@paulmck-ThinkPad-P72> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Frederic Weisbecker Those tracing calls don't need to be under ->nocb_lock. This commit therefore moves them outside of that lock. Signed-off-by: Frederic Weisbecker Cc: Josh Triplett Cc: Lai Jiangshan Cc: Joel Fernandes Cc: Neeraj Upadhyay Cc: Boqun Feng Signed-off-by: Paul E. McKenney --- kernel/rcu/tree_plugin.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index b08564b..9846c8a 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h @@ -1703,9 +1703,9 @@ static bool wake_nocb_gp(struct rcu_data *rdp, bool force, lockdep_assert_held(&rdp->nocb_lock); if (!READ_ONCE(rdp_gp->nocb_gp_kthread)) { + rcu_nocb_unlock_irqrestore(rdp, flags); trace_rcu_nocb_wake(rcu_state.name, rdp->cpu, TPS("AlreadyAwake")); - rcu_nocb_unlock_irqrestore(rdp, flags); return false; } @@ -1955,9 +1955,9 @@ static void __call_rcu_nocb_wake(struct rcu_data *rdp, bool was_alldone, // If we are being polled or there is no kthread, just leave. t = READ_ONCE(rdp->nocb_gp_kthread); if (rcu_nocb_poll || !t) { + rcu_nocb_unlock_irqrestore(rdp, flags); trace_rcu_nocb_wake(rcu_state.name, rdp->cpu, TPS("WakeNotPoll")); - rcu_nocb_unlock_irqrestore(rdp, flags); return; } // Need to actually to a wakeup. @@ -1992,8 +1992,8 @@ static void __call_rcu_nocb_wake(struct rcu_data *rdp, bool was_alldone, TPS("WakeOvfIsDeferred")); rcu_nocb_unlock_irqrestore(rdp, flags); } else { - trace_rcu_nocb_wake(rcu_state.name, rdp->cpu, TPS("WakeNot")); rcu_nocb_unlock_irqrestore(rdp, flags); + trace_rcu_nocb_wake(rcu_state.name, rdp->cpu, TPS("WakeNot")); } return; } -- 2.9.5