Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1345087lqj; Mon, 3 Jun 2024 20:14:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUBE4K+cRd+Xrvne5LwJOZZWkyKsDN8m/aIT3aqXSRgcNz3ROu7vL0rr3W6e++2hq50STgXZphZYBZKJ6XbnxbtFE3WtlPLzzSLdSJSsg== X-Google-Smtp-Source: AGHT+IE72pLvXRidK2MM3R2Wmkv0Mb8/lmJxzE3T6otz90BWk7HL50xjmmHctJv+BzYDj13rk5QM X-Received: by 2002:a05:6214:4a92:b0:6ae:d65b:124e with SMTP id 6a1803df08f44-6aed65b1568mr127668306d6.14.1717470879433; Mon, 03 Jun 2024 20:14:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717470879; cv=pass; d=google.com; s=arc-20160816; b=urD6Su7QNza2Rmr55xbVSvp+K7ONVNd8y7PDcsFdRdb/1iEmWRLmCddiQQRiYsCu52 0TaL25UZxk0Vz3ZWrzG7KSuU8MOsYYQf8OxZQhlDkehv0zQG/9NbvJL6r+HMPpVi6qgL nnZJIL5umyppQL8TtIVlevp3f/28I+uRnDQdr6r8cBqlQzCgZiq9l9+KyGpw2Uc16sq7 0GbR2T6aGwWBlebdKTZIj57yEg2ZyS3sI4NJee1w9Fqptm2AeLzPHRhqHH70CTlR+8wz SjfqRo2EyCzCNYqOJrcpvLhJ1G8RNKddchp1PK0LRHJl8XLZcPwZDqdbdrk6/JnWD06S ICwA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=LpeojLEMoIB5Qe5dA55y5sos0mhxcc3J+1C4Cl7Uyoc=; fh=0Vs1palXGM+MbgVr3r7aJAp1K6Gt3wGcW4oP1RemMt0=; b=CSO0aQThxqNyTiyKy62d3n3fm2+120y5EplIMs7aZtYNTc9io61c7K3rnJcJj9yVSq H2KxchK6rAJxo2U+O4v2j7oMpOIJqtfmDdIQDoc36O/baMNjsshpnDS2KCDN+shJwXrG Y8xRXCeq24OebMzZi+Ir3bxc+pBaY9Ysr/R97qb5mPavXrb0viukOzEZyfIVOWp7qDPm fDFSljCSGSGFArNhdWTMOUJnzyFbL2r5l9U86qPo5q8g18li7WdSUlxczUt64rcyRW4U jPiMHiXvDD8kOy3Rxut1RTgcE2CLsvZ9kOR4eA1lw82rkXQlHVf5ozVIhJ01B/H6sjkp Bc6A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GDJV3gBe; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-199979-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199979-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43ff2597693si95963131cf.548.2024.06.03.20.14.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 20:14:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199979-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GDJV3gBe; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-199979-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199979-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 1C92B1C23578 for ; Tue, 4 Jun 2024 03:14:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7575513D50F; Tue, 4 Jun 2024 03:14:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GDJV3gBe" 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 885B922066; Tue, 4 Jun 2024 03:14:33 +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=1717470873; cv=none; b=KAaTgb7But3rjglyUwsdUTz33eRUVm73Bc2sOLdTsePHvS+BGHDldmKWDPaRSSfs/gVJ4/KRbO053AxHhhLW6SZvWu2gqaR31tQ6OWQvv9IFGlvp1ul5TLWgal0kAd/YDR0Km6b1D9a747IJ3B2HrEuRl3IsmBRzqP85TztKZOU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717470873; c=relaxed/simple; bh=Y91STFUCBS5I/f7wR4WgBsbDWCjl/VYug12ElcXUQs4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NTFwCNGIXtpJk2hRrJ3O6rGIYF0eJHg0/MvESqGK3EB9FOSG9lqgmvtVae5SaPpFHYytBiwOhT4ODYrDbhqvhIJm+u1WYdrosxsMGSi7coFw9T8wVIpzQUDzcheSlMHBS/OLNBKWhaUpsnnwKN/ruBHYQCFoZ/JA5VY5aqRDzXw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GDJV3gBe; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3F53C2BD10; Tue, 4 Jun 2024 03:14:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717470873; bh=Y91STFUCBS5I/f7wR4WgBsbDWCjl/VYug12ElcXUQs4=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=GDJV3gBeWOrn+xSH2fuoO6wwBXYEJyIadmBJWdFjm4aSzQvKeoBTndNRX8OoybBb7 V6M9BGG+d87M/olwksI7vbJfUdCu27rcM8SgMU0NtXo4DBUSQOtleLIBVAfMomXhA3 /ShN3/lupFFEKAHtoXqk6d7mzeWBVSX9/N8lR2QXWQcFOJrXLAmQh67Gqx7/IgbQ7H w1y12w1Tj29xPvb/qMSd6okgRK0OBvfPl4cnOLdojU+rBt7x1z2yz0B6RTemnVg+CL jaU37QWyG8HhbSMXkkOnWua9QRr0Yt8Rd7NL0/xJL7/cPtwoTiuis4skEbXW8S0yxy EMVNdIGjsR2CQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 7A8AACE0886; Mon, 3 Jun 2024 20:14:32 -0700 (PDT) Date: Mon, 3 Jun 2024 20:14:32 -0700 From: "Paul E. McKenney" To: Z qiang Cc: frederic@kernel.org, neeraj.upadhyay@kernel.org, joel@joelfernandes.org, urezki@gmail.com, rcu@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rcutorture: Skip debug object testing for cur_ops without ->debug_objects set Message-ID: Reply-To: paulmck@kernel.org References: <20240528030054.4525-1-qiang.zhang1211@gmail.com> <1195a9a3-db87-465d-a3b0-ee92d67da954@paulmck-laptop> <4a6d1e70-ec91-4b6d-8f69-290c4ef57b7f@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=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Jun 04, 2024 at 10:19:08AM +0800, Z qiang wrote: > > > > On Mon, Jun 03, 2024 at 12:55:30PM +0800, Z qiang wrote: > > > > > > > > > > > > > > On Tue, May 28, 2024 at 11:00:54AM +0800, Zqiang wrote: > > > > > > This commit make rcu_test_debug_objects() early return when the > > > > > > specified cur_ops not set the ->debug_objects. > > > > > > > > > > > > Signed-off-by: Zqiang > > > > > > --- > > > > > > kernel/rcu/rcutorture.c | 5 +++-- > > > > > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > > > > > > > > > diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c > > > > > > index 08bf7c669dd3..9b8c277ab91a 100644 > > > > > > --- a/kernel/rcu/rcutorture.c > > > > > > +++ b/kernel/rcu/rcutorture.c > > > > > > @@ -3495,8 +3495,9 @@ static void rcu_test_debug_objects(void) > > > > > > return; > > > > > > } > > > > > > > > > > > > - if (WARN_ON_ONCE(cur_ops->debug_objects && > > > > > > - (!cur_ops->call || !cur_ops->cb_barrier))) > > > > > > + if (!cur_ops->debug_objects || > > > > > > + WARN_ON_ONCE(cur_ops->debug_objects && > > > > > > > > > > You lost me here. Given that we have "!cur_ops->debug_objects" before > > > > > that WARN_ON_ONCE(), why do we need "cur_ops->debug_objects" inside of it? > > > > > > > > > > Also, we don't get here unless the rcutorture.object_debug kernel boot > > > > > parameter is specified, don't we really want to WARN_ON_ONCE if the > > > > > current flavor does not support that? > > > > > > Maybe I didn't describe it clearly enough, this > > > modification is mainly to filter out test types that do not support > > > double call_rcu*() checking, for example tasks, tasks-rudes, > > > task-tracing ;) . > > > > Understood. > > > > It is just that in my experience, it is a good thing for rcutorture to > > splat when asked to do something that it cannot do. Or do you have a > > use case where this is problematic? > > > > Hi, Paul > > > This is a scene I mentioned before: > > The rcutorture.object_debug is set true, but the tasks-tracing does not support > duplicate cur_ops->call check, but the debug_objects test was still done. > > insmod rcutorture.ko torture_type=tasks-tracing fwd_progress=4 > n_barrier_cbs=4 object_debug=1 > > [ 106.082416] rcutorture: WARN: Duplicate call_tasks-tracing() test starting. > [ 106.082533] tasks-tracing-torture: rcu_torture_read_exit: Start of test > [ 106.082543] tasks-tracing-torture: rcu_torture_read_exit: Start of episode > [ 106.105552] rcutorture: duplicated callback was invoked. > [ 106.105567] rcutorture: duplicated callback was invoked. > > for call_rcu*() that does not support double call checking, if > continue to test, > "rcutorture: duplicated callback was invoked". will output, > I just want to avoid the output of this error message :) OK, but then why not just avoid setting rcutorture.object_debug for the torture_type values that do not support it? Thanx, Paul > Thanks > Zqiang > > > > I don't count the fuzzers because they are supposed to avoid specifying > > things that are supposed to fail. ;-) > > > > Thanx, Paul > > > > > Thanks > > > Zqiang > > > > > > > > > > > Hi, Paul > > > > > > > > The rcutorture.object_debug is set true, but the tasks-tracing does not support > > > > duplicate cur_ops->call check, but the debug_objects test was still done. > > > > > > > > insmod rcutorture.ko torture_type=tasks-tracing fwd_progress=4 > > > > n_barrier_cbs=4 object_debug=1 > > > > > > > > [ 106.082416] rcutorture: WARN: Duplicate call_tasks-tracing() test starting. > > > > [ 106.082533] tasks-tracing-torture: rcu_torture_read_exit: Start of test > > > > [ 106.082543] tasks-tracing-torture: rcu_torture_read_exit: Start of episode > > > > [ 106.105552] rcutorture: duplicated callback was invoked. > > > > [ 106.105567] rcutorture: duplicated callback was invoked. > > > > [ 106.111269] rcutorture: WARN: Duplicate call_tasks-tracing() test complete. > > > > > > > > Thanks > > > > Zqiang > > > > > > > > > > > > > > Or do you have a use case that needs to silence these warnings? > > > > > > > > > > Thanx, Paul > > > > > > > > > > > + (!cur_ops->call || !cur_ops->cb_barrier))) > > > > > > return; > > > > > > > > > > > > struct rcu_head *rhp = kmalloc(sizeof(*rhp), GFP_KERNEL); > > > > > > -- > > > > > > 2.17.1 > > > > > >