Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E0F551A3160 for ; Mon, 24 Feb 2025 04:40:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740372024; cv=none; b=U5wyapDGLj2GIrh/XA3NT3oUS+jpTuoNaRTRRixmAoXxBDNuRcbNXAObzIdt3owk9DUUwwrJLawFjQDz1qQqcwdIiajAV0Io2c0myvAYyWeWs4SPrOA8e8fpeZ03GJjLNKtbl0eT1i/3IdReyuPdmd20737rtH6siPB94EonlXM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740372024; c=relaxed/simple; bh=7aOn/n9ydfblSdbbERb2pYl6zATx2cIjSiLxOM7O9Sg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RQ5HLdo1uDMwm03tgyU6hNxTO9WTjjHdJa7PnciAaf4nJ5hZrevjLVY3CD4BagUK7xzswGvbvx6WSjEkeO8rfsNrA+XP8LxC0++TXmDj2z41Ub1D4+8P+sDcX100B2cYpYItEVD8q49Szi1LsYwgMXfIVZT3pb8HVz6/N08lyGw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=jVy1eQux; arc=none smtp.client-ip=209.85.222.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jVy1eQux" Received: by mail-qk1-f169.google.com with SMTP id af79cd13be357-7c0c5682c41so268352385a.2 for ; Sun, 23 Feb 2025 20:40:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1740372022; x=1740976822; darn=lists.linux.dev; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:feedback-id:from:to:cc:subject:date :message-id:reply-to; bh=z0o+mSdoO6usP7w4Zy/wg4+VbHOO8CmvBrRjZXQYt6U=; b=jVy1eQux5Gw/QMD6ibsaGnBdxOqwjCK9K4bbnMlXfhSzA6QofIgU9hgD1EegpBiac/ kCyDFUQJwyV2jSl33otScHAFk0GFrDMKNyLAVvXvv2DccRXCySiDpQDmR9wvsiTvoXIN XcfHgE4n1M49pDoQhyB5vRKUxWv/i8AXsGs0B6/Nxdk2YqiHEtcg46vhIO5kJqSx5C49 RjC8Kw8yE1tgos0ohcHNSGsl0akOFq9mUwYQWAK9Dfun02qmT3/u47gY9LEmq2uNXuGA GxD+zzbOzS65ZQookdGEm6vvxsaJ0oiM1yVZdAf82gnT+rNjPcY9vKxsjGOilpuvq6x/ xEpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740372022; x=1740976822; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:feedback-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=z0o+mSdoO6usP7w4Zy/wg4+VbHOO8CmvBrRjZXQYt6U=; b=ahowK5RE2/T8GPouKEYshkG6qPf9Y7+73IfetdFjIsrmIDIlmWp5p4uQgMqhrxzd7n ZD8R2AWmxT9PD55SvXQ3vYxdvGbIUIu33GNgJWcfSAkD3tfMnHXP0l2tfrfYlShcqmIN w+sI2Qsrwzfnk78zceeyXmwnSxRwik0mJX4nly6+nCgCF9aBo9FShcaGYsfGA6SZfmB/ EFjeh5lZNPQFXexJ+VDRJJQoCu3y60B/V6O08W5BUfgj5Tl4xo7kut35vYRNnZe8r0CC lCH7piPNQVwE+4JjR88x4shhc5b+KFcvAiMxEKkGAAVX8kwC7NEbHeuy+YE8AY50A5LH IDHA== X-Forwarded-Encrypted: i=1; AJvYcCUsWSmKg7PnZmi0V6D8rY+CKdci2eqFS0xgxwGSk3goe6TTTaZ+fbDpgdOymGEtunt8ogRvXPM=@lists.linux.dev X-Gm-Message-State: AOJu0YzdzP07GoJhLt8xbWiC6brXxsjZyYgOnrRhbqVa0qKGiPGUTfWQ p6XDIJNWZI4pFWlPT0QYDq9U2vbM5AUNhZw+/kBCwKR4vWzYBEbx X-Gm-Gg: ASbGncuK1R3i59Rj/1Su2XjqXVB1hapKA/63sx7Fr5nfR4jBeFISvLioypoOAXbQssg qnSNCk7a5iG7t/qOUscn4rCtL+nH1ve16BgrbEMyFBJp6AMoeC0pt4sCrVr7/DDBnOgLb92lcj/ Z+Q/sBphoXerQEGWeMNRYpxJzxUHFyerN7KM/yXaew8U5PJOgAfkZeez4pNOzuJbwwi+ySB4DPX tsKm1n6YnNp++fQQ9P53ccEteWxl9YSoTn36Gg2fPf/VSgUoMb9v7MpIo3tGf/lJ0CNW2K0t7qB jJb+NpvzmFQbmDWZSV6OMmktOTTp+HNDb/MC90NJRKOv1fUVMOSKLxOY17AboD/jf/3sXHtSo/Y Tarpw/0LQbCCvIQAI X-Google-Smtp-Source: AGHT+IFRc07AA7Z7laLAli64j6wQl2yXaXyNFQuy6nLDkttwtei6GdMMgQviFMx62jjYAIFEbkyvJA== X-Received: by 2002:a05:620a:3916:b0:7c0:bc63:7b76 with SMTP id af79cd13be357-7c0cf9504bamr2172811285a.36.1740372021630; Sun, 23 Feb 2025 20:40:21 -0800 (PST) Received: from fauth-a1-smtp.messagingengine.com (fauth-a1-smtp.messagingengine.com. [103.168.172.200]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7c0a4b4908esm886184085a.80.2025.02.23.20.40.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Feb 2025 20:40:21 -0800 (PST) Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfauth.phl.internal (Postfix) with ESMTP id AB8371200068; Sun, 23 Feb 2025 23:40:20 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-09.internal (MEProxy); Sun, 23 Feb 2025 23:40:20 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdejjeekfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpeffhffvvefukfhfgggtuggjsehttdertddttddv necuhfhrohhmpeeuohhquhhnucfhvghnghcuoegsohhquhhnrdhfvghnghesghhmrghilh drtghomheqnecuggftrfgrthhtvghrnhepvdevkeegkeeggfevkeetjedvhfekieekudfg ueeghfekgeduvddulefgteegudelnecuffhomhgrihhnpedtuddrohhrghenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegsohhquhhnodhmvghs mhhtphgruhhthhhpvghrshhonhgrlhhithihqdeiledvgeehtdeigedqudejjeekheehhe dvqdgsohhquhhnrdhfvghngheppehgmhgrihhlrdgtohhmsehfihigmhgvrdhnrghmvgdp nhgspghrtghpthhtohepledpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepohhlih hvvghrrdhsrghnghesihhnthgvlhdrtghomhdprhgtphhtthhopehprghulhhmtghksehk vghrnhgvlhdrohhrghdprhgtphhtthhopegrnhhkuhhrrdgrrdgrrhhorhgrsehorhgrtg hlvgdrtghomhdprhgtphhtthhopehovgdqlhhkpheslhhishhtshdrlhhinhhugidruggv vhdprhgtphhtthhopehlkhhpsehinhhtvghlrdgtohhmpdhrtghpthhtohepphgvthgvrh iisehinhhfrhgruggvrggurdhorhhgpdhrtghpthhtohepfhhrvgguvghrihgtsehkvghr nhgvlhdrohhrghdprhgtphhtthhopehrtghusehvghgvrhdrkhgvrhhnvghlrdhorhhgpd hrtghpthhtohepsghoqhhunhesfhhigihmvgdrnhgrmhgv X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 23 Feb 2025 23:40:20 -0500 (EST) Date: Sun, 23 Feb 2025 20:40:19 -0800 From: Boqun Feng To: Oliver Sang Cc: "Paul E. McKenney" , Ankur Arora , oe-lkp@lists.linux.dev, lkp@intel.com, Peter Zijlstra , Frederic Weisbecker , rcu@vger.kernel.org Subject: Re: [linux-next:master] [rcu] c9b55f9da0: WARNING:at_kernel/rcu/rcutorture.c:#rcutorture_one_extend_check[rcutorture] Message-ID: References: <202502171415.8ec87c87-lkp@intel.com> <08e755d1-9f7d-4238-ac2d-1869d68a8ddc@paulmck-laptop> <64d58e80-3601-4f9b-ae46-756dd124345f@paulmck-laptop> Precedence: bulk X-Mailing-List: oe-lkp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Sun, Feb 23, 2025 at 07:21:25PM -0800, Boqun Feng wrote: > I finally find why I cannot reproduce this, I accidentally used > next.2025.02.10a to build the kernel first, which has commit > ("rcutorture: Move RCU_TORTURE_TEST_{CHK_RDR_STATE,LOG_CPU} to bool"), > which changes Kconfig RCU_TORTURE_TEST_CHK_DRD_STATE into a bool and > that disabled the test... (because config from you has it as =m). > > On Mon, Feb 24, 2025 at 10:22:02AM +0800, Oliver Sang wrote: > > hi, Paul, > > > > On Fri, Feb 21, 2025 at 05:02:51PM -0800, Paul E. McKenney wrote: > > > > [...] > > > > > > > > > > > > And rcutorture's WARN_ON() has a bug that is exposed by that change > > > > > in Kconfig option. Does the patch shown below help? > > > > > > > > the patch does not fix the WARNING in our tests. attached one dmesg FYI. > > > > > > Just to make sure that I understand, this patch was applied against this > > > commit, correct? > > > > > > c9b55f9da0d2 ("rcu: limit PREEMPT_RCU configurations") > > > > > > I am guessing this based on this dmesg line: > > > > > > [ 109.553307][ T781] CPU: 1 UID: 0 PID: 781 Comm: rcu_torture_rea Tainted: G T 6.14.0-rc1-00007-gc9b55f9da0d2 #1 > > > > above line is not from the dmesg I attached in last mail. it's from > > https://download.01.org/0day-ci/archive/20250217/202502171415.8ec87c87-lkp@intel.com/dmesg.xz > > which is for our original report. > > > > > > > > Is this really the case, or am I confused? > > > > we applied your patch as: > > > > 89519085afdf2 fix for c9b55f9da0 from Paul > > c9b55f9da0d2c rcu: limit PREEMPT_RCU configurations > > f001b7165def8 osnoise: provide quiescent states > > > > so in the dmesg I attached in last mail (I attached it again in this mail): > > > > [ 0.000000][ T0] Linux version 6.14.0-rc1-00008-g89519085afdf (kbuild@9871be4fdbcc) (gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT Fri Feb 21 00:34:02 CST 2025 > > ... > > [ 117.463907][ T812] CPU: 1 UID: 0 PID: 812 Comm: rcu_torture_rea Tainted: G T 6.14.0-rc1-00008-g89519085afdf #1 > > > > the change of this 89519085afdf2 is as [1] > > > > I'm not sure if it's better to upload dmesg for fix patch to > > https://download.01.org/0day-ci/archive/20250217/202502171415.8ec87c87-lkp@intel.com > > again, so I did not do that. sorry if this causes confusion. > > > > not sure if this is the correct applyment? thanks > > > > [1] > > diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c > > index d26fb1d33ed9a..de85a88810cf6 100644 > > --- a/kernel/rcu/rcutorture.c > > +++ b/kernel/rcu/rcutorture.c > > @@ -1873,6 +1873,8 @@ static void rcu_torture_reader_do_mbchk(long myid, struct rcu_torture *rtp, > > #define ROEC_ARGS "%s %s: Current %#x To add %#x To remove %#x preempt_count() %#x\n", __func__, s, curstate, new, old, preempt_count() > > static void rcutorture_one_extend_check(char *s, int curstate, int new, int old, bool insoftirq) > > { > > + int mask; > > + > > if (!IS_ENABLED(CONFIG_RCU_TORTURE_TEST_CHK_RDR_STATE)) > > return; > > > > @@ -1902,8 +1904,10 @@ static void rcutorture_one_extend_check(char *s, int curstate, int new, int old, > > WARN_ONCE(cur_ops->extendables && > > !(curstate & (RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED)) && > > (preempt_count() & PREEMPT_MASK), ROEC_ARGS); And we need another fix for the WARN_ONCE() above because in non-preemptible RCU on a preemptible kernel, rcu_read_lock() is just preempt_disable(). Sending both really quick. Regards, Boqun > > - WARN_ONCE(cur_ops->readlock_nesting && > > - !(curstate & (RCUTORTURE_RDR_RCU_1 | RCUTORTURE_RDR_RCU_2)) && > > + mask = RCUTORTURE_RDR_RCU_1 | RCUTORTURE_RDR_RCU_2; > > + if (IS_ENABLED(CONFIG_PREEMPT_RCU)) > > Now look into this, I think this should be: > > if (!IS_ENABLED(CONFIG_PREEMPT_RCU)) > > because: > > * For preemptible RCU, ->readlock_nesting() will return > rcu_preempt_depth() > > * For non-preemptible RCU, ->readlock_nesting() will return > preempt count. > > , which means if RCUTORTURE_RDR_PREEMPT or RCUTORTURE_RDR_SCHED is in > the curstate for *non-preemption RCU*, ->readlock_nesting() will be >0. > That is, the "mask" needs to consider _PREEMPT and _SCHED for > *non-preemption RCU*, not preemptible RCU. > > Paul? Did I get it right? > > Regards, > Boqun > > > + mask |= RCUTORTURE_RDR_PREEMPT | RCUTORTURE_RDR_SCHED; > > + WARN_ONCE(cur_ops->readlock_nesting && !(curstate & mask) && > > cur_ops->readlock_nesting() > 0, ROEC_ARGS); > > } > > [...]