Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp6206172rwi; Sun, 23 Oct 2022 20:30:59 -0700 (PDT) X-Google-Smtp-Source: AMsMyM73wDgReTflkxWkgfpAmcs6yxl9hy9ERHVjezQ8uCaCvCqcQBPyIx5ANL7RpHCYpW2QtiDK X-Received: by 2002:a17:907:75f1:b0:78a:f935:647d with SMTP id jz17-20020a17090775f100b0078af935647dmr25217942ejc.587.1666582259090; Sun, 23 Oct 2022 20:30:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666582259; cv=none; d=google.com; s=arc-20160816; b=nViwnTrCWHzg9tfvtwBoMGY01yneTpstVP+vYelvuFnTJ/wx4NZnJ+Y1H+GTzfqIRG Ak2I3GekebUMO0s9WgYYD9tdd11qMXEAU92VgskxKWgdvaC3Q44slJFsGC02NM8Pz8ua oS8CMzShw2LtxPLnhHnthS4fyGMDh17OmMKsztQo4NCtykDVG0MBbGKk8A25lxn1oPhD iKV5jQq2qFZlhYvx52wi1KFFXw7oFAJqdPZC/z8lsDeocRJChAI5VS+p6z+sg3NvmbTd h1H2CQ/TVmj9kka872R8B4J3NKiuZi6+18MoGw7e6Z3kWsdBl1g+tqfAEe2rt27n5V0P yeIQ== 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=h7nruavi0FuW4RIFzA9ZhiWNtZObUuFqVKckJkAQ1b4=; b=wVhctV28f0H2A/UsHfkgjXPH1x33Kwpzpo+gh2RjlpYqJYk3UZwhAmKlI8DKCVSU8l lvn3OWL3DlVdmazVTlQFRKJu8xrrjktKQJb6i/Vf/rPdR4xOcKGCos+nEC7rrALwPFCo rYJj/5Kou+ZpdU62FNyuER4E+jCDYxV3NQb71+s/5zAoQDsCdqOqmQu5YxnkDOYZiaP/ oLyggg4psDKGEOB8Lol6amHEeXuMuryJTo1zoGmTseJbOagIvyQy3uNEeYEANctB8q2Y ySwdiahe+g2d6B8BTin+EuUW2lVvXHHGN+NTPEYHqNn0mboIgo7XW9HGiO9YgzkI+abY 2N6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dAU+g7aX; 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 k3-20020a50ce43000000b00447b0cc1501si26730575edj.99.2022.10.23.20.30.34; Sun, 23 Oct 2022 20:30:59 -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=dAU+g7aX; 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 S230357AbiJXDTJ (ORCPT + 99 others); Sun, 23 Oct 2022 23:19:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230189AbiJXDSX (ORCPT ); Sun, 23 Oct 2022 23:18:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9103796BE; Sun, 23 Oct 2022 20:15: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 C045D60FD4; Mon, 24 Oct 2022 03:15:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2B75EC433D6; Mon, 24 Oct 2022 03:15:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666581341; bh=4Xvm6jK59KSpB6qK0TAqSA8L9T7SwXigqw4yDjifrb0=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=dAU+g7aX4ijcHi134G1LjCXS+JYLIJ3l18+vr7o3AqaqjQaYYs3+MDxJRTqLzHEoe jpRSLwUdhCiXeaBsIz4p7dwAcu76iQey/tLVZi1lCaHptTtCrcRxhlktTLYTw8kVWc eQ4sbAs7AnlTndMKuMdQz/jm1V3loxNs1BLX8zkaZULumXds19FZH+vgkP1IDuctvm JrA1XvJjs+fOqkWSkO2FCv/O6fBNXOFAZPIB8HaasWWsvEQu3Z4l35eQ+d/A7yBeHC OUUrIL3c450VgpaOI1LaYHJ1zmtCTkZO9kBG/uxuJ0DcMErpQ6nD+bkBEMflaoyGkS vw+5IUP4EDhTA== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id BFB565C0A11; Sun, 23 Oct 2022 20:15:40 -0700 (PDT) Date: Sun, 23 Oct 2022 20:15:40 -0700 From: "Paul E. McKenney" To: Joel Fernandes Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, rostedt@goodmis.org, Uladzislau Rezki Subject: Re: [PATCH rcu 13/14] workqueue: Make queue_rcu_work() use call_rcu_flush() Message-ID: <20221024031540.GU5600@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org References: <20221019225138.GA2499943@paulmck-ThinkPad-P17-Gen-1> <20221019225144.2500095-13-paulmck@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 Sun, Oct 23, 2022 at 08:36:00PM -0400, Joel Fernandes wrote: > Hello, > > On Wed, Oct 19, 2022 at 6:51 PM Paul E. McKenney wrote: > > > > 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 behavio > > On ChromeOS, I can see that queue_rcu_work() is pretty noisy and the > batching is much better if we can just keep it as call_rcu() instead > of call_rcu_flush(). > > Is there really any reason to keep it as call_rcu_flush() ? If I > recall, the real reason Vlad's system was slowing down was because of > scsi and the queue_rcu_work() conversion was really a red herring. There are less than 20 invocations of queue_rcu_work(), so it should be possible look through each. The low-risk approach is of course to have queue_rcu_work() use call_rcu_flush(). The next approach might be to have a Kconfig option and/or kernel boot parameter that allowed a per-system choice. But it would not hurt to double-check on Android. Thanx, Paul > Vlad, any thoughts? > > thanks, > > - Joel > > . > > > > Signed-off-by: Uladzislau Rezki > > Signed-off-by: Joel Fernandes (Google) > > Signed-off-by: Paul E. McKenney > > --- > > 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; > > } > > > > -- > > 2.31.1.189.g2e36527f23 > >