From patchwork Wed Oct 19 22:51:43 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: 5900 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp572751wrs; Wed, 19 Oct 2022 15:56:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5PhqxC9ZaQXvtImFrN0ptsp707jHEZ/J2xb0j6WmYPiGOjR61GRkXsAXiizP3TxTxfSEbE X-Received: by 2002:a05:6402:3594:b0:45d:acf9:c782 with SMTP id y20-20020a056402359400b0045dacf9c782mr9890830edc.63.1666220183813; Wed, 19 Oct 2022 15:56:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666220183; cv=none; d=google.com; s=arc-20160816; b=KIajwy9BO/Tt0TcioMdpB7Vs1ivODnmAC7wa2DKqweOA6aC4SXwwwsv1ZyNtf44M4b Xyo1OphQrpye5HajCdxwS4FUYewLgJNo5lWVLKguVuI/x5SozGfhoTTamUl9stYghfzM +gQ1Elb4iHNbUZdeCjn1308QcaDhY2Di253J/B/c7d6GCrLhAybei7FEoY32hhV4BBLp 72cr1SZWOcrwJMuu+1EUrREq1WNOmP2TCB6roN+yaobIP1SKJVHmIPQPTVxxWTCKkGhi c5OEynvx2L3eELHA5ijQs0Vb3OX5M0D+rAufUi5FudZNwqPqR2PMViAxKJv6SKzIkfTx 6dyw== 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=epiCdlh3N/Gv1+NoiXViWJJb+hqfNVXnDkq7hxPiaKA=; b=vZ2TA3vroRtM1cdNIw7z0M2/3rtkoFO3S6pGCLHfPkxVArtPxs3oob5t6bs31RaVg1 TAgOQlAXnd1k1IqXJd2UCcZsnYN031+wifZB0LA2mEYjL4ZGtC3kbPjmRVZO/uiAg96Q Tewkosh9HAqJPYfyeR/D1nLxdsu82SF+j5QwNGrAZFqsI2MgD2TTfoBa9xtshEFYkPOu BuVsjsFB/omqbLN2Xy+064YbQA7AC/B1Td1sFmygO8B8/NYIPQd4xMpM3TNrisSSGQl3 BCh6k5ypy1qd6aAPxKuXceRqMDfVWEPgwO0mQooiozg1VgPac7dp4VbUnRJh+Q4nam1R xy2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="UAl/iSQs"; 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 qf38-20020a1709077f2600b0078db5170767si16763675ejc.18.2022.10.19.15.55.58; Wed, 19 Oct 2022 15:56:23 -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="UAl/iSQs"; 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 S231435AbiJSWwQ (ORCPT + 99 others); Wed, 19 Oct 2022 18:52:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230387AbiJSWvx (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 E8ADD17C156; Wed, 19 Oct 2022 15:51:49 -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 CC78E619EE; Wed, 19 Oct 2022 22:51:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E67BC43150; 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=MQ9LcMOdsSRTz38i4kDvf32ku4ItL7jI+4EvtYFoPC0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UAl/iSQsuk1+2M6aDOUrrdjnjX8vuEJOxRzokcPebrX5Up7justHJnoXtapDkXiir H08aHzwHoHP7hWGyOpklSAJhMwDvlPg4eJI2BtOj1fQ03u27rQVehlmN6QMsyhd27t F03ExYx0PhDcUp//Auh8E/Xn2//+YcgvzH5YFVrMJ5FVgdcnZ1HrECn0AX3Uw7dNdS uUTzQDtaldoqtV7/RUFeGOBGi4v7t4EYHeyuRAETDRrDmvp5sX1wGTG3Zxl9wMs8ZK 8vk5sqJoRvXkOoyp7Tt6sFvwNnqMNGEuCPxtpW7TzwGXSi8pSeFv57FpHBmibahNCN 3ZupmHrjfTdww== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 8D1785C0E57; 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, Uladzislau Rezki , Joel Fernandes , "Paul E . McKenney" Subject: [PATCH rcu 13/14] workqueue: Make queue_rcu_work() use call_rcu_flush() Date: Wed, 19 Oct 2022 15:51:43 -0700 Message-Id: <20221019225144.2500095-13-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?1747158495419848108?= X-GMAIL-MSGID: =?utf-8?q?1747158495419848108?= From: Uladzislau Rezki call_rcu() changes to save power will slow down RCU workqueue items queued via queue_rcu_work(). This may not be an issue, however we cannot assume that workqueue users are OK with long delays. Use call_rcu_flush() API instead which reverts to the old behavior. Signed-off-by: Uladzislau Rezki Signed-off-by: Joel Fernandes (Google) Signed-off-by: Paul E. McKenney Signed-off-by: Joel Fernandes --- kernel/workqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 7cd5f5e7e0a1b..b4b0e828b529e 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -1771,7 +1771,7 @@ bool queue_rcu_work(struct workqueue_struct *wq, struct rcu_work *rwork) if (!test_and_set_bit(WORK_STRUCT_PENDING_BIT, work_data_bits(work))) { rwork->wq = wq; - call_rcu(&rwork->rcu, rcu_work_rcufn); + call_rcu_flush(&rwork->rcu, rcu_work_rcufn); return true; }