From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E586244362; Fri, 19 Jan 2024 21:47:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705700847; cv=none; b=FITkIbPyGcSQ/AQyGM4EdYLfiXeGSeeMyD35+yi2z27d4H0yfISyDgVewzmFhTvOqY/J97ggsVX7/uzRJ1FIgowUnJu+Wa4ytwHIOyQd9T0N7+n2B+eALHo9kT8/G0Z3fPbNm6tLER542sbQ31f0CG41pNIFblxESW/CRjkvk0A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705700847; c=relaxed/simple; bh=d1jNRu5Jqv52A+YfDyvK0d0IJXmzb7fcNKIJCXuOjiY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QRZjyscaWQ7HBLj3w70xTTyDNtK1aeNlOfYK0kwOslJAT/lloUjJp/Bu99lvqGRTusRhGRNUEutz2EunkB4nLGh84ylROTISj1VPVdDDNvJ4DnbT3dbdwRSwlgT2ggdZcyayEDPNMI+RX+gETE/fy8+Ka97ZDhgel4D3wny1t4E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=RYj1u7PX; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RYj1u7PX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1C8C7C433C7; Fri, 19 Jan 2024 21:47:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705700846; bh=d1jNRu5Jqv52A+YfDyvK0d0IJXmzb7fcNKIJCXuOjiY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RYj1u7PX0K83PiVxxUCQQEYz3ph3NLFwpq3fnLn85HmDRKd41WeCTP+ue40e8sKxj bQRQcdTKwUsEzelcME4pvuWyFqqM1L9qRnR9yH5LXNvQXBamcHp+xM9VuGFmxUkMqn C8LCyDqT+3o9XPdvrB0az0D/oPHIBThBR3CB7tMiT0OSNlh31nOs6yJdBrwQORyrT/ FreQkWtyOCUsYmmGXsptPOYOUIcQREHQK6ySh+RcYx5GD1XFg8Y7zWEX0jA0echUfj g7ceuE8eQAaRwRv8/iyX168Z53UdzfkgRsP6TItT03YnHYlibwSrYopBTLMKve67Gp d465adJ4gj5KQ== Date: Fri, 19 Jan 2024 22:47:23 +0100 From: Frederic Weisbecker To: "Paul E. McKenney" Cc: Zqiang , quic_neeraju@quicinc.com, joel@joelfernandes.org, rcu@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rcu/nocb: Check rdp_gp->nocb_timer in __call_rcu_nocb_wake() Message-ID: References: <20240117102616.18302-1-qiang.zhang1211@gmail.com> <3b63cf39-3805-4c1d-b79b-fdd5aeb17db3@paulmck-laptop> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3b63cf39-3805-4c1d-b79b-fdd5aeb17db3@paulmck-laptop> Le Thu, Jan 18, 2024 at 06:51:57AM -0800, Paul E. McKenney a écrit : > On Wed, Jan 17, 2024 at 01:07:25PM +0100, Frederic Weisbecker wrote: > > Le Wed, Jan 17, 2024 at 06:26:16PM +0800, Zqiang a écrit : > > > Currently, only rdp_gp->nocb_timer is used, for nocb_timer of > > > no-rdp_gp structure, the timer_pending() is always return false, > > > this commit therefore need to check rdp_gp->nocb_timer in > > > __call_rcu_nocb_wake(). > > > > > > Signed-off-by: Zqiang > > > --- > > > kernel/rcu/tree_nocb.h | 3 ++- > > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > > > diff --git a/kernel/rcu/tree_nocb.h b/kernel/rcu/tree_nocb.h > > > index 54971afc3a9b..3f85577bddd4 100644 > > > --- a/kernel/rcu/tree_nocb.h > > > +++ b/kernel/rcu/tree_nocb.h > > > @@ -564,6 +564,7 @@ static void __call_rcu_nocb_wake(struct rcu_data *rdp, bool was_alldone, > > > long lazy_len; > > > long len; > > > struct task_struct *t; > > > + struct rcu_data *rdp_gp = rdp->nocb_gp_rdp; > > > > > > // If we are being polled or there is no kthread, just leave. > > > t = READ_ONCE(rdp->nocb_gp_kthread); > > > @@ -608,7 +609,7 @@ static void __call_rcu_nocb_wake(struct rcu_data *rdp, bool was_alldone, > > > smp_mb(); /* Enqueue before timer_pending(). */ > > > if ((rdp->nocb_cb_sleep || > > > !rcu_segcblist_ready_cbs(&rdp->cblist)) && > > > - !timer_pending(&rdp->nocb_timer)) { > > > + !timer_pending(&rdp_gp->nocb_timer)) { > > > > Hehe, good eyes ;-) > > > > I had that change in mind but while checking that area further I actually > > wondered what is the actual purpose of this RCU_NOCB_WAKE_FORCE thing. If > > we reach that place, it means that the nocb_gp kthread should be awaken > > already (or the timer pending), so what does a force wake up solve in that > > case? > > > > Paul, any recollection of that? > > Huh. We never actually do RCU_NOCB_WAKE_FORCE in v6.7, if I followed > all the code paths correctly. > > Historically, I have been worried about lost wakeups. Also, there > used to be code paths in which a wakeup was not needed, for example, > because we knew that the ending of the current grace period would take > care of things. Unless there was some huge pile of callbacks, in which > case an immediate wakeup could avoid falling behind a callback flood. Ok then looks like it's time for me to add RCU_NOCB_WAKE_FORCE removal in my TODO list...unless Zqiang would like to give it a try? :-) > > Given that rcutorture does test callback flooding, we appear to be OK, > but maybe it is time to crank up the flooding more. > > On the other hand, I have started seeing the (very) occasional OOM > on TREE03. > (In addition to those that show up from time to time on the > single-CPU TREE09 scenario.) Interesting, are those recent? Bisectable? Thanks!