From patchwork Tue Nov 22 01:04:16 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: 24082 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1929953wrr; Mon, 21 Nov 2022 17:05:17 -0800 (PST) X-Google-Smtp-Source: AA0mqf6nMj6zJC7ZaZIVNCnHqTV5DySKX2mgNY6bX0KZWC1o5a1STCOZhN1Ogk3uaEA6pnkE3Ppd X-Received: by 2002:a63:711e:0:b0:477:5654:c37e with SMTP id m30-20020a63711e000000b004775654c37emr10145097pgc.206.1669079117628; Mon, 21 Nov 2022 17:05:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669079117; cv=none; d=google.com; s=arc-20160816; b=ewq0YVWt0CZfABso0IOyXUn/Vgg9xn+EyF7ZRGFgsNLkq/HvzwbzLc/rWRiTZn5odH 0qOFQ4lyAT4gVMm9FT0UiCMNQBU4t4Wm1xu8Ip1JCTwjamWayp+WRAa9PfLJnEmAUCQR NLErNE2oEXmSpXMdHKJJGCaYp8HkX2vO8q8fe4bm5bNX/hFg7qulo2JF9XYOmXppLAxj y6SaCSUknB7xlm+4rZIgOWhmjnK9k8hoRZX1tfmFhmDZwGlBt/IsptdfwUrwBsYJ52VC yQUIqEBuN8r6IWHVjPziISYljEgtFU0cqRfRl6c62Znc3hlE7NRMvqVQ/pE7IreyUkEg ySnA== 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=sq0VinMZKKGVm9Ra8yHoFvNvJge0VyfEivvpKmAYVLoHqP71RyxBYypLzHJw+3MVnB MFVCGHn+L+RrztGTB/buCtWthdiBZqubCgAe7cn5BUbd3R98TVM5VGk00p4q15d9eVyZ nYVmpFpnuYErAcMp8q58Xu41W3f9vJ2vDfOMsQg/VaCRCWvosYFM9DFb1NleQ2bssrt0 GGLcz/LWySlBf3cer3AcB41lAT+fAOzz1ShojEI//EDcPduO2uBKY7MXZZpK5csh1n7R tgZb9JzqLUKOBhd7z+g4zZKDSsxVILWWCJTzE+eHf7FS/KvfdyqzSp6ptNZBF6SvdL+v qRNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SR10hgGo; 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 o4-20020a656a44000000b00459ba7ace44si14549544pgu.514.2022.11.21.17.05.04; Mon, 21 Nov 2022 17:05:17 -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=SR10hgGo; 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 S232119AbiKVBEp (ORCPT + 99 others); Mon, 21 Nov 2022 20:04:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231936AbiKVBEZ (ORCPT ); Mon, 21 Nov 2022 20:04:25 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A09EF14003; Mon, 21 Nov 2022 17:04:24 -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 F422D6151D; Tue, 22 Nov 2022 01:04:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2375CC4314D; Tue, 22 Nov 2022 01:04:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669079063; bh=wpKgIqAJ7kcPSavM/RzKNoKYI274ueWKeTYgl/A5jf8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SR10hgGofc1YR6A1qP88bTh66K8mo+POYKhycLn8nv1e9j2wUMJGi/j4h9olXJtSO +GSGs3Np2ZXT/chkhEZHj/A/0PcoJuqEINDnaroz0crkrT2WwfAidzt5fZvdLINC+6 3/RRZWLv0aqi7y93XNk+taL/6N3cXf1qcsr5ZGx5a6F13ntxyrtbIQ4bJVsU3ssml9 8YJKEpjMrAHhLsqfMzuWgyZIwBlpbBkt82i+yST/YX1ITaCpRFf3u+XjHOWFkrC2gP VpC7q8Ud4lFFjyx8TE62gAO5eHv//IKpitC8MTh5xAEIohwxQnn1vlEuiD1Xq9ZZZZ 6084RRt3sF4Rg== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 8554A5C146C; Mon, 21 Nov 2022 17:04:22 -0800 (PST) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com, rostedt@goodmis.org, "Joel Fernandes (Google)" , "Paul E . McKenney" Subject: [PATCH v2 rcu 11/16] rcu/rcutorture: Use call_rcu_flush() where needed Date: Mon, 21 Nov 2022 17:04:16 -0800 Message-Id: <20221122010421.3799681-11-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20221122010408.GA3799268@paulmck-ThinkPad-P17-Gen-1> References: <20221122010408.GA3799268@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750156304960638871?= X-GMAIL-MSGID: =?utf-8?q?1750156304960638871?= 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();