Received: by 2002:a05:7412:ba23:b0:fa:4c10:6cad with SMTP id jp35csp396314rdb; Thu, 18 Jan 2024 06:54:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IHCsGYRE4+xxVicxO+4HTwtyI/oz3jgLAfh4a+uPK+ML1o4e1//OD2ZUAuwUdxecWOxZ6O3 X-Received: by 2002:a05:6402:1488:b0:557:33f1:3ef9 with SMTP id e8-20020a056402148800b0055733f13ef9mr1138199edv.26.1705589650688; Thu, 18 Jan 2024 06:54:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705589650; cv=pass; d=google.com; s=arc-20160816; b=zHlfPwNiqf1rgnB4Thbg+JTf0CY8gZAxGcPPCWFyxJ2xCPUpqK9RSgUX8aB8RHrYeH ym4obOUr1NtZLY0znDei4PEdayr1dR0o6HZ0jzUZ0TzIPWGZE2YYhDGrG3W3K3TgQIQM qDAKgFg5sY621MqQgO2LIYUrpzrILw5oXAtTAjcOKRXbuCLp2ck35SAqviF/dEgr0h1E tOecN9MA3L1W3LN4I0f13gizoQXcb0p/uUhtNqm2Jdq920baBz7qZijKxwas73XFd01e EegCrUuImphgL1HSA8XaMqIO9tYRriEdErkaxTGjb6h40ZEAd1SikrXYFluZnsB+J/GR dLOg== 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:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=UJ45gxM17+dGuaaWJPHUMJqVpDukmS0ZWRaubM1nA7g=; fh=Gad9dG/lKKZ+enoK/15dNn9kNMI94sYQhN9R2c5iDyY=; b=0395mgmLpTRIKQcXyJghY/qkMzRh3OndO3p4pxGOKbFhnKU9VcF99EOpB7+deSbxGx gFtgNNv+Kq0uo78X9I3OgOiiv1tteRndY4SHMEI+fEHc2oHBCKmvx4P/9095ppfPDlXE KXhWJ+0N2Hm8s77FPvaWcEAYRlj4dGOtd6ugPVrcSJevIg8fQHhCIJTzRyxx7QiBcH97 5Baa6n76JEXYt0W9ZCIB9P6gzemYeWfdbP47Uy4MY4FxwAJUilRqHjKx2IVGLrTmwggh owrwKNpAKp5vfq6QYibPCjEzfdg3+h8kpqaAK+m3A+AXsPJOGVUZtXUNjF6aUDMOqx3y UxiA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Q0n0h9Rp; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-30231-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30231-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id dz13-20020a0564021d4d00b0055a0cf15adfsi583649edb.463.2024.01.18.06.54.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 06:54:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-30231-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Q0n0h9Rp; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-30231-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30231-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 4B2C71F22D13 for ; Thu, 18 Jan 2024 14:54:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7E2D41E489; Thu, 18 Jan 2024 14:54:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Q0n0h9Rp" 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 A65FD64A; Thu, 18 Jan 2024 14:54:05 +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=1705589645; cv=none; b=FGSlYpQLj9zdRrFbXVAH5DHdaUgDphg0J6lvuSXIVs++nCdZgBB8+/3qCdKgeOR26/c5DPWZNoTZyY2TMe3+HeXL8+ciouT2isL5Gni/MzGnoVDnuq7vbciQ5NfqYwk0lHTquMsGs5hgDtAgIzikp1bTPQ3ER0LpeHv0BD7HTSk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705589645; c=relaxed/simple; bh=1Jn0XHYRRXVuTax8LF9dSlbDnIyPC5KmcJWbAbWx/lM=; h=Received:DKIM-Signature:Received:Date:From:To:Cc:Subject: Message-ID:Reply-To:References:MIME-Version:Content-Type: Content-Disposition:Content-Transfer-Encoding:In-Reply-To; b=H/2hQGWfSqChPwgvDItGjXEAI5fUL3bJfhvyFMOwSrXLDyMVZScnMSnXeKEgD4dXNr+YubDLCxE6CQJ0GcVCwtT+9HuckWLJiRRVAwuj9GtaYlVp4qZvKTJeJy+HLtE+LpbWs2bTTtISKppXXlTBD+2yzC1JzXHyW5wNUvFqaRE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Q0n0h9Rp; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 161C3C433C7; Thu, 18 Jan 2024 14:54:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1705589645; bh=1Jn0XHYRRXVuTax8LF9dSlbDnIyPC5KmcJWbAbWx/lM=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=Q0n0h9Rpr/p9IKT4pj93/ExJ1XtuDhOEazP63FMN5MJvLMP81iWxHO2vzsguzkqgN YjwyFKlwuADYHXYXOSFcwD61AhSBJT/EI+/59E7b+eYdhE4M1+CBALaFfPjMJ4mnMI jQcBHtPm0JaLi2Qf3Ehto79qJabYFvmAyVfPXJdlF5FO5Z3CpYldP+Yq9PMsP+nC49 /VrZFKeRY4KJn7q+Uqg6Q+OVAQEkAEJZtn+GPrvJ4jWWSk/YxKHLWQVaK/YhVaWp52 YQP/caufxaaL4pzdpkEr4On6XNGW3VrTL1Ut6cONnFGrH6FpYClvjsXiXs8F0FXbmS QkaFNQs9AOlYA== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 97D09CE0546; Thu, 18 Jan 2024 06:54:04 -0800 (PST) Date: Thu, 18 Jan 2024 06:54:04 -0800 From: "Paul E. McKenney" To: Frederic Weisbecker 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: <280f9a31-218c-4afd-a568-28efab378580@paulmck-laptop> Reply-To: paulmck@kernel.org 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> On Thu, Jan 18, 2024 at 06:51:57AM -0800, Paul E. McKenney wrote: > 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. > > 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.) Oh, and queued for further review and testing, thank you both! Thanx, Paul > > In the meantime: > > > > Reviewed-by: Frederic Weisbecker