From patchwork Wed Oct 19 22:51:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 5893 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp571956wrs; Wed, 19 Oct 2022 15:53:42 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7PLJLi99vTjgZp/E69Mtf10lKFLxojcJLEIjp7aQlVJrDo7w6kudN6Xd7/VSOq+rSMBjNZ X-Received: by 2002:a05:6402:170f:b0:458:9653:6466 with SMTP id y15-20020a056402170f00b0045896536466mr9609063edu.181.1666220022025; Wed, 19 Oct 2022 15:53:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666220022; cv=none; d=google.com; s=arc-20160816; b=Zoj20FLM/q5W4pdLHe9SFHGpy2Xqgxk7csRXS+2LLFBIzOgl2U8MpAwByDjys4/XD1 Y4zGiAHgWf0PTVuV13f/CA7CujP00cJdaeEOxv7ZovnPNeezbQ+Hb0TZn3lF6OEwbb+A rz19lhKLAhYdzUCKiqbdyy3bELUOsCU1zkKB888bJ/YG1z2IL705Cpj7q/42t7wNSsmv r+VFUN1Fnu8JT/j3oHHI4n//RFL14H0IPpAF4apc1UVK4X1zlpDnyQFjcMOwinqNL70j jzhqC9OTrtvGY2FMnRXLENByaCoqYUEbLmRyZjKw0FmMVAeHQKjpIvCKcZRvGAO7dvth KoDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=rrIm2tPhLjnx4rUE0Af77vY86wceGm13xfYULUrPKV4=; b=PcxZkoyRcnntoGPQ/lFXVTBtRfgnLXcV6IopNPUQXtf1zqmfBamBNBy8E7NnNhmMrL uxLWyP3118P/KoQbjv/kvUXgP4n4RwztsdOZZ+od41o5gmOqWKUsgz0W3Ztze5qRh5rc cVB1bFTgi31bJLRSHkYboeSGugbmpEfpY8XXileVklziybbkXeRVpkKRAn1NVVzpQ9+r Fq188TrsXyNcA0Dm2MB1Kva0fW1YElM/d30ugWexZJgqf8l0CpUWkI0Gbq/zkREQOYv8 oWKStidCQ+04NoJb0amf/4T/l7YbyRIGwvD+i1FHk0EYV+v+dRSDkwNiErPMeiPkB2f7 jfrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XnFcmUZ2; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hc42-20020a17090716aa00b0079194297b1bsi8972268ejc.815.2022.10.19.15.53.16; Wed, 19 Oct 2022 15:53:42 -0700 (PDT) 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=XnFcmUZ2; 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 S231289AbiJSWwD (ORCPT + 99 others); Wed, 19 Oct 2022 18:52:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230348AbiJSWvx (ORCPT ); Wed, 19 Oct 2022 18:51:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAE2818E738; Wed, 19 Oct 2022 15:51:48 -0700 (PDT) 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 5C4C8619EC; Wed, 19 Oct 2022 22:51:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 207B4C43149; Wed, 19 Oct 2022 22:51:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666219907; bh=wpKgIqAJ7kcPSavM/RzKNoKYI274ueWKeTYgl/A5jf8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XnFcmUZ2KYoW9kGNBzloi+MxX7n5i8F/9xf0y6fxNKVhySs9d/a/YOOs9lNi/H1Y5 WCif+YrOEtegJM+39/G9d8vhepALCQ44WHzOzlcZaCty4nrU/9EFhvVmMh25Pr5yld Um9mIGAVQe6GaTRgnpbQZSZQU2LV6Prj4ZXEyBf/qvolgrnXLHDqDK1w4ItaLH5cGW OvRtaBm81QyxZUszFv9oAHw62IO7ikd3dUXVZE45TqsggZ5xtZR7omER3n4OW5hTcZ pAvFHX+Ln38I9JRH7M9hXMXzddaBoZqIWNQUD2kJUu+z5Jb/47kEE8TPXB8B2kN2o9 irsVvQdlc6xmQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 899405C0DA6; Wed, 19 Oct 2022 15:51:46 -0700 (PDT) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, rostedt@goodmis.org, "Joel Fernandes (Google)" , "Paul E . McKenney" Subject: [PATCH rcu 11/14] rcu/rcutorture: Use call_rcu_flush() where needed Date: Wed, 19 Oct 2022 15:51:41 -0700 Message-Id: <20221019225144.2500095-11-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20221019225138.GA2499943@paulmck-ThinkPad-P17-Gen-1> References: <20221019225138.GA2499943@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747158325737176380?= X-GMAIL-MSGID: =?utf-8?q?1747158325737176380?= From: "Joel Fernandes (Google)" call_rcu() changes to save power will change the behavior of rcutorture tests. Use the call_rcu_flush() API instead which reverts to the old behavior. Reported-by: Paul E. McKenney Signed-off-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney --- kernel/rcu/rcutorture.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c index 503c2aa845a4a..c8ddb4b635b77 100644 --- a/kernel/rcu/rcutorture.c +++ b/kernel/rcu/rcutorture.c @@ -510,7 +510,7 @@ static unsigned long rcu_no_completed(void) static void rcu_torture_deferred_free(struct rcu_torture *p) { - call_rcu(&p->rtort_rcu, rcu_torture_cb); + call_rcu_flush(&p->rtort_rcu, rcu_torture_cb); } static void rcu_sync_torture_init(void) @@ -551,7 +551,7 @@ static struct rcu_torture_ops rcu_ops = { .start_gp_poll_exp_full = start_poll_synchronize_rcu_expedited_full, .poll_gp_state_exp = poll_state_synchronize_rcu, .cond_sync_exp = cond_synchronize_rcu_expedited, - .call = call_rcu, + .call = call_rcu_flush, .cb_barrier = rcu_barrier, .fqs = rcu_force_quiescent_state, .stats = NULL, @@ -848,7 +848,7 @@ static void rcu_tasks_torture_deferred_free(struct rcu_torture *p) static void synchronize_rcu_mult_test(void) { - synchronize_rcu_mult(call_rcu_tasks, call_rcu); + synchronize_rcu_mult(call_rcu_tasks, call_rcu_flush); } static struct rcu_torture_ops tasks_ops = { @@ -3388,13 +3388,13 @@ static void rcu_test_debug_objects(void) /* Try to queue the rh2 pair of callbacks for the same grace period. */ preempt_disable(); /* Prevent preemption from interrupting test. */ rcu_read_lock(); /* Make it impossible to finish a grace period. */ - call_rcu(&rh1, rcu_torture_leak_cb); /* Start grace period. */ + call_rcu_flush(&rh1, rcu_torture_leak_cb); /* Start grace period. */ local_irq_disable(); /* Make it harder to start a new grace period. */ - call_rcu(&rh2, rcu_torture_leak_cb); - call_rcu(&rh2, rcu_torture_err_cb); /* Duplicate callback. */ + call_rcu_flush(&rh2, rcu_torture_leak_cb); + call_rcu_flush(&rh2, rcu_torture_err_cb); /* Duplicate callback. */ if (rhp) { - call_rcu(rhp, rcu_torture_leak_cb); - call_rcu(rhp, rcu_torture_err_cb); /* Another duplicate callback. */ + call_rcu_flush(rhp, rcu_torture_leak_cb); + call_rcu_flush(rhp, rcu_torture_err_cb); /* Another duplicate callback. */ } local_irq_enable(); rcu_read_unlock();