Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5151321rwb; Mon, 21 Nov 2022 17:41:37 -0800 (PST) X-Google-Smtp-Source: AA0mqf5rapWFgyxGM/pXYkSnldvQ0pOj7161WTG4tki3JbbsZdMy3ieiR6VLiqLD5MuGGj79E9RJ X-Received: by 2002:a17:902:ef81:b0:188:d41f:c37b with SMTP id iz1-20020a170902ef8100b00188d41fc37bmr1777529plb.132.1669081297704; Mon, 21 Nov 2022 17:41:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669081297; cv=none; d=google.com; s=arc-20160816; b=imM0aInk6b+BrhZfeeP2Qm/mG1XwPL12+Zz0RjRYxOuypq3MqCTbg5V/hWFDYlchdy d1hSsXgSCC0VRAMaJo9F2GF23jP0L2verZSew11ZRC8FpA5GTZkQR44j6Wy1F5qteAOE T2nWe8C22Q08R2Eh18dQCjmq390I5vXxL671WKdMBhUnhaChc3OAVmxToSFEXA5smegV N1yzkCIHUEAfTIk7CXYQqcnvEQhwmeMURfyXkQpCMUyuy85zCGUKqoiccrQUqaGjDVw9 x8bsbDkG8ZtrmSNNpuXbsisyMh8PRTKkaI9IC/sHzzJA33wO0NFOKGUvL01cI3ZX07pK zUEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=02x8UVUXucmhAa70ild/jLjc6VmRxcv8kDcX6cHz+/Y=; b=J7JdCoMJQxv2nrs/Fl6IR53LeeW94scHZvJ2pz+huFb5A8Qd+ps8MEBlZFR6Vjt1EG NzP0HDJ8nJwCtGusd4x35OkgRcA4a6HbPej+4V5yZ+t1p8I3lS6LuqBblv5mH18yYOAH xG5tpueY+uQtFil1BoSJoUASsMI9IDLv3sHqpLlzKFkMxKtXSyNgUY8qF3MYcj9Cjljo bSAMHRpRBxNrg64vzGjK/KPCmsekhAoLKOIRsmtd9J5nOI1+iuA4E5VPTFzRCw33rj7h yfhd/9HOviUVrogUawr+XU/gMvIHvVIcNLsuue6M8mVDyTDIdGWjZB6b2bPZV/FSFz4D 400w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Al+YBoEE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f1-20020a056a0022c100b00571d0fe4bf9si13252355pfj.197.2022.11.21.17.41.20; Mon, 21 Nov 2022 17:41:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Al+YBoEE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232012AbiKVBaX (ORCPT + 93 others); Mon, 21 Nov 2022 20:30:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230152AbiKVBaV (ORCPT ); Mon, 21 Nov 2022 20:30:21 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A626E8FB2C; Mon, 21 Nov 2022 17:30:20 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 428E761518; Tue, 22 Nov 2022 01:30:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 92C8FC433D6; Tue, 22 Nov 2022 01:30:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669080619; bh=jUZcCkMSTRNtZdyFv5KfYCxYq1zoggq+MPCMZ2FS/bY=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=Al+YBoEE7BD/NlQ5fesXawqAmkuoHypdBfvdACapsCKBFWSi6poXcgxdE29vQ7cWx Psi/uSBoorr0nZjRPIKSea44HfvMuAdprk2bu9/mT2aKMvgPeHuDGDwcbfcqrLizrp Ag5wtmuwp2J//KK8XsUoGZbQeweY9sC8C5SiR+NRZKpRqyDiUiqy54433gRf7f6amO 2cqbuQ8Q0YZb+Q9uj6ZldPXZ6huf5MQqnQZP2OwlZq63jk14w4c8UOnAgeLrKZyA11 MMdQH0V5UG/ZnmH81C3yZcdDW8CbceIL/64N6jvYa3yIxJvEN8OGZ11r7K7ZedBhL/ WUMECzyI08t8A== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 242895C0641; Mon, 21 Nov 2022 17:30:19 -0800 (PST) Date: Mon, 21 Nov 2022 17:30:19 -0800 From: "Paul E. McKenney" To: Zqiang Cc: frederic@kernel.org, joel@joelfernandes.org, rcu@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rcu-tasks: Use accurate runstart time for RCU Tasks boot-time testing Message-ID: <20221122013019.GW4001@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <20221121150150.319715-1-qiang1.zhang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221121150150.319715-1-qiang1.zhang@intel.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 21, 2022 at 11:01:50PM +0800, Zqiang wrote: > Currently, only get jiffies once as the runstart time for all RCU > Tasks testing. it's not accurate, for each RCU Tasks type test, since > corresponding type of synchronize_rcu_tasks*() be invoked, so before > each RCU Tasks test starts, we need to wait for the grace period of > the previous RCU Tasks test to end, there will be a deviation in the > start time of the RCU Tasks test. > > Therefore, this commit at the start of each RCU Tasks test, re-fetch the > jiffies time as the runstart time. > > Signed-off-by: Zqiang Good catch! Applied with the usual wordsmithing, so please do check. Thanx, Paul > --- > kernel/rcu/tasks.h | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) > > diff --git a/kernel/rcu/tasks.h b/kernel/rcu/tasks.h > index b0b885e071fa..4a991311be9b 100644 > --- a/kernel/rcu/tasks.h > +++ b/kernel/rcu/tasks.h > @@ -1813,23 +1813,21 @@ static void test_rcu_tasks_callback(struct rcu_head *rhp) > > static void rcu_tasks_initiate_self_tests(void) > { > - unsigned long j = jiffies; > - > pr_info("Running RCU-tasks wait API self tests\n"); > #ifdef CONFIG_TASKS_RCU > - tests[0].runstart = j; > + tests[0].runstart = jiffies; > synchronize_rcu_tasks(); > call_rcu_tasks(&tests[0].rh, test_rcu_tasks_callback); > #endif > > #ifdef CONFIG_TASKS_RUDE_RCU > - tests[1].runstart = j; > + tests[1].runstart = jiffies; > synchronize_rcu_tasks_rude(); > call_rcu_tasks_rude(&tests[1].rh, test_rcu_tasks_callback); > #endif > > #ifdef CONFIG_TASKS_TRACE_RCU > - tests[2].runstart = j; > + tests[2].runstart = jiffies; > synchronize_rcu_tasks_trace(); > call_rcu_tasks_trace(&tests[2].rh, test_rcu_tasks_callback); > #endif > -- > 2.25.1 >