Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2762061rwb; Wed, 30 Nov 2022 10:29:32 -0800 (PST) X-Google-Smtp-Source: AA0mqf6KYMZLGKD38/yimTduSyuEPc4FlOlnUe5j8y0Lmen1U3a1L+WAx1HhUI7Fdxqyll9GZ7ix X-Received: by 2002:aa7:d555:0:b0:464:6485:419b with SMTP id u21-20020aa7d555000000b004646485419bmr43143660edr.382.1669832972006; Wed, 30 Nov 2022 10:29:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669832972; cv=none; d=google.com; s=arc-20160816; b=mZCbkzV3r4wrA/48n/ZMv+A4pQYLEGG8GSZlwm095QWjRRQERXfHmBPM5AT1xUKkxe nepVlOUKsddUvHt/FVucVR1Y1EO+RQPkNCkNbiSQ4ZweWLOIlEJ+zGVVCAKeTeXJ4ip4 Cm6JF53jUacncyo4HG/SVLs+bXf1du5Cy2NVZKPLOsG88+Eq/rSCeifYLB8m6WTYmct7 XBJr7DhXOYznp0p+okUTPnqkGPeDlG/0VN/QLXYp4EcrL4mPXtAWeZMM043J66INtQx2 LreZ2R5pJSiLE16Hdx7mImoNppIMDEJJvCWr/YyJ5yqTCY98GW0U1Zr82zzHi981IZhd QloQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:reply-to :message-id:subject:cc:to:from:date:dkim-signature; bh=8je2dr0D+JPscmU3nCeRvYTS4BsOHfiSCqonaPXXbSQ=; b=UCniplispGqL4WWcY6mGLry11vAkDJGpw067DCmrRv3yQM62m6NERJ1oHS9+dqNzAH QKj3vHmsuuJb+EOEhLj8fT+3Jl1yoCQ5Xa7SV4QVBS5NRXOLXFcFuKDVo8Ownqi45dIU GCbDIpA94kQSIIA2OgoRc6AvbrOn5jvDdwKb6+Uw4JwQ4vg+jQrTVTnBsdWly/QvmmwE aHT6PynJfljoO01i0MSp3S3KeA20Y/eIzSTCM8Cvt8Sp72gr7RoVTbghSoyuELecgTWu mFIjmtWbNqqH1YuWzAuYCuuvm8BjJH10xyCqrCzFsEJWEBlRI+ki8j2WsPiE0lmEoK3U 0Ekw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KoBp+JJF; 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 nd23-20020a170907629700b0079dc9dcbbb6si2189890ejc.337.2022.11.30.10.29.12; Wed, 30 Nov 2022 10:29:31 -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=KoBp+JJF; 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 S229903AbiK3SNk (ORCPT + 83 others); Wed, 30 Nov 2022 13:13:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230070AbiK3SNX (ORCPT ); Wed, 30 Nov 2022 13:13:23 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 973922A717; Wed, 30 Nov 2022 10:13:19 -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 ams.source.kernel.org (Postfix) with ESMTPS id 54695B81C9C; Wed, 30 Nov 2022 18:13:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 12907C433C1; Wed, 30 Nov 2022 18:13:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669831997; bh=jEXYy2sRGOMTywAVi6nSyBZ4IPniFAdcqehMf/7xaAA=; h=Date:From:To:Cc:Subject:Reply-To:From; b=KoBp+JJFP9XX5vMmouLEgYef2BeT9hv2NqucWpaDWpTSiioISbDM++dWYySNUo8hB fRw2iYavo5MoxOiP6JKZ220PJ196ad070E6/5UDjCGHFiE4AqVCPahzxvgqXzIpCdC HN3Z/V4/JgNb3mEFChv/XK/H9n70ZpvPlUbX9xRk4OawQIkVoQGxsDMP3wr2Jq4xLT mwDpZY5IBnVWFTx4SJXpJvUnBcc7mnEIOkIAqZM8CVDkpkDZT32GMct2GwtEAUOU3y HcTSeLUib4HXLAwfsc9HUe8HJ1j3Ygg82cyCEkkJmIrxFTxO5JLRmo36RedW429lvk r7HI/YlKG9DZQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id B268F5C051C; Wed, 30 Nov 2022 10:13:16 -0800 (PST) Date: Wed, 30 Nov 2022 10:13:16 -0800 From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com, rostedt@goodmis.org Subject: [PATCH v3 rcu 0/16] Lazy call_rcu() updates for v6.2 Message-ID: <20221130181316.GA1012431@paulmck-ThinkPad-P17-Gen-1> Reply-To: paulmck@kernel.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-7.0 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 Hello! This series provides energy efficiency for nearly-idle systems by making call_rcu() more lazy. Several NOCB changes come along for the ride: 1. Simplify rcu_init_nohz() cpumask handling, courtesy of Zhen Lei. 2. Fix late wakeup when flush of bypass cblist happens, courtesy of "Joel Fernandes (Google)". 3. Fix missing nocb gp wake on rcu_barrier(), courtesy of Frederic Weisbecker. 4. Make call_rcu() lazy to save power, courtesy of "Joel Fernandes (Google)". 5. Refactor code a bit in rcu_nocb_do_flush_bypass(), courtesy of "Joel Fernandes (Google)". 6. Shrinker for lazy rcu, courtesy of Vineeth Pillai. 7. Add laziness and kfree tests, courtesy of "Joel Fernandes (Google)". 8. Use call_rcu_hurry() instead of call_rcu, courtesy of "Joel Fernandes (Google)". 9. Use call_rcu_hurry() for async reader test, courtesy of "Joel Fernandes (Google)". 10. Use call_rcu_hurry() where needed, courtesy of "Joel Fernandes (Google)". 11. scsi/scsi_error: Use call_rcu_hurry() instead of call_rcu(), courtesy of Uladzislau Rezki. 12. percpu-refcount: Use call_rcu_hurry() for atomic switch, courtesy of "Joel Fernandes (Google)". 13. Make queue_rcu_work() use call_rcu_hurry(), courtesy of Uladzislau Rezki. 14. Use call_rcu_hurry() instead of call_rcu(), courtesy of "Joel Fernandes (Google)". 15. Use call_rcu_hurry() for dst_release(), courtesy of "Joel Fernandes (Google)". 16. devinet: Reduce refcount before grace period, courtesy of Eric Dumazet. Changes since v2: o Rename call_rcu_flush() to call_rcu_hurry() to avoid naming conflicts in workqueues as suggested by Tejun Heo. o Apply acks and reviews. https://lore.kernel.org/all/20221122010408.GA3799268@paulmck-ThinkPad-P17-Gen-1/ Changes since v1: o Add more adjustments to avoid excessive laziness (#15 and #16 above). o Get appropriate Cc lines onto non-RCU patches. https://lore.kernel.org/all/20221019225138.GA2499943@paulmck-ThinkPad-P17-Gen-1/ Thanx, Paul ------------------------------------------------------------------------ b/drivers/scsi/scsi_error.c | 2 b/include/linux/rcupdate.h | 9 + b/kernel/rcu/Kconfig | 8 + b/kernel/rcu/rcu.h | 8 + b/kernel/rcu/rcuscale.c | 67 +++++++++++- b/kernel/rcu/rcutorture.c | 16 +- b/kernel/rcu/sync.c | 2 b/kernel/rcu/tiny.c | 2 b/kernel/rcu/tree.c | 11 + b/kernel/rcu/tree.h | 1 b/kernel/rcu/tree_exp.h | 2 b/kernel/rcu/tree_nocb.h | 34 +----- b/kernel/workqueue.c | 2 b/lib/percpu-refcount.c | 3 b/net/core/dst.c | 2 b/net/ipv4/devinet.c | 19 +-- b/net/rxrpc/conn_object.c | 2 kernel/rcu/rcuscale.c | 2 kernel/rcu/tree.c | 129 +++++++++++++++-------- kernel/rcu/tree.h | 11 + kernel/rcu/tree_nocb.h | 243 ++++++++++++++++++++++++++++++++++++-------- 21 files changed, 434 insertions(+), 141 deletions(-)