Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp1272018rdb; Fri, 19 Jan 2024 13:47:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IF5WAHj0IftWKXJQeiPOQi/NjhKZcUwmr+MSOI3aPvm3eer4sPXWL7yvZXHAB62uBfyTiQZ X-Received: by 2002:a05:6a00:198c:b0:6da:c96e:8297 with SMTP id d12-20020a056a00198c00b006dac96e8297mr2332239pfl.0.1705700854810; Fri, 19 Jan 2024 13:47:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705700854; cv=pass; d=google.com; s=arc-20160816; b=qxGJdhJR2c1rcOAvfpjlmFmaHQC5iBTyiiWnx1DQjBF7GsX3U513inG4LaO2HwLYOi q6Djb/YhHc2IMmBD5tuAMvRwnYk/Hqv0XnqMaw+2Pwhfg5+rIHZ5BDAK0HCoXs6+kUl2 3IRSvvYrRuZ2rE2IRtCKmVfJCshQHZ4gvU6++NjpPqyKhPKliEv9rILsd2Av5Vexjlbu 9wgkicLfMQDPOMvDUe/eoEIx1WpAFDROXMMLkw2cVrR3qrUQFdZ12C7FKmURUIPAYWah Uamt1uRrAQ972vvzTLNil/gDbd6KpSe6FHkSD/T/SZcsPFg86dwUpmIca8KOqIL55PP7 4Htw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=x1dN7HgpIBXwGKwXCxLP8wwFtITdQTUo5K7NKWTziLo=; fh=MafLCBMeJdza2BmWk0LKWMFy0KWPwlCFjm2IOJhOIPU=; b=H4YadlTkpx26OzcxtWDP1MZJs7naU4+Ou5KO4JMu7uR1V8AKpevKrG02apPXxtfXbk OtKyX2+HQ9uBSsVRJnIClCXaK7Q4iohTVhnFm3GLTuqi6NMBevDCBn2jtzVWtm2ZCn9e eXz0iCn+R8tMmyXZCdHBNAcEJi++M5e5VNbjxZEVya9M6WfyqjQrkJnXhuyNfDVlzB1I MFA4oMt908kCNbiwnvlx0YYf7aFbP7+lqpVjCOVT5QCPwVcnBEzgRlP417HjBMCxdBFR b4rsAwaCcDEuk7+wvA2QNZR6rHwD4e3lYuGDoNCu3EI8oaIBNHwkEpfmVvRF+5EVVjos yLHA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RYj1u7PX; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-31590-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31590-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id fc27-20020a056a002e1b00b006da2ee05030si6473890pfb.222.2024.01.19.13.47.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 13:47:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-31590-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RYj1u7PX; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-31590-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31590-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 5C3B2284B82 for ; Fri, 19 Jan 2024 21:47:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BE6BE58229; Fri, 19 Jan 2024 21:47:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="RYj1u7PX" 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 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!