Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp7628766rwr; Wed, 10 May 2023 10:26:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5Nz/62ZmVQPYssziAvuLfNi5THu2DbOhot1/BlMBiZfP/kJmA3U8yZ7QBqSaqQAHQyrtVA X-Received: by 2002:a17:902:7001:b0:1aa:df9e:2d19 with SMTP id y1-20020a170902700100b001aadf9e2d19mr19623868plk.54.1683739599192; Wed, 10 May 2023 10:26:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683739599; cv=none; d=google.com; s=arc-20160816; b=E3BIcGwIz0JdlDvz0YUhu6tFq/QKpxGwoPx4iqvuypdfa2APDA6p7l6jLQJPVO4G0+ S1NVijMFnZAC0B6JhsO/D/PHSRIEZUkUmp2uFtQ1xkpat5xJEfNXjxTOBQKwFHe9PHgM 23D6D4TiYlI0AsW7tBKhB4JOAaIsS44CUmwGa4gkoEGOadctpsO4t1NYGpODorgunG+Y LWviLBtZDEbYXMuQfZIvl9b7eev9/cZFAEWyDjlIEYTUyaqpBTMtwqwrbFpTm4TyrwTY 10CO49fFy0MIVx1nYwSonjaIdemZsqso4nxLUO0wLFKH4tVP4BiEQnHtZBm0mkx5CSoD S64Q== 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=OgyMt5CjrADoekLz8jzrLQBji3fE6poxHYYtprjCF7o=; b=khmqoVK01HltuBbcvqTek1d9ppgL3PJANUnLFeXSEdt6c6RGKG7u3+b43Wi6OblOjT L5LjcJMSL5EjyRKRFdgm6R5/AXb3Se7+dhQG6uYsXOdtRRB54x19fNy/y1xm0TsSAQPc kGIone+d0LQjgJYZymM/agVW2Yp09faFdTTug0DFBCN35VATnsHJA79bTyHIxorMzknN W07Gs1apgdVvUUnQnIlLGVnDIf+3CWSLO+pFPU3JgknfBWjkPRiqgpkkO623y5Q3SgT7 X/I1tKfqkWSoymdlYpthcSc+r+Lg3PINdmSY3fam9JGO5H3DB5W+mTKaTpROjQKAFTBf rQcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lvhINCbZ; 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 l14-20020a17090ac58e00b00250bf29b6d6si3663604pjt.165.2023.05.10.10.26.24; Wed, 10 May 2023 10:26:39 -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=lvhINCbZ; 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 S236338AbjEJRDb (ORCPT + 99 others); Wed, 10 May 2023 13:03:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236215AbjEJRDZ (ORCPT ); Wed, 10 May 2023 13:03:25 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 127935592; Wed, 10 May 2023 10:03:06 -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 BE92964A28; Wed, 10 May 2023 17:02:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 027FAC4339E; Wed, 10 May 2023 17:02:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683738164; bh=lQYiBo5yWC21n7sADnCbbnl6Y7dNLkILdUz1+j0vDYU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lvhINCbZ0cNh8wGTMn4LkrMuFyCbgVgrX+wEC6QQ5GeojTVMJES5uLsz9m83BYFPy qjdLxtc3Q03j6HB2L2V2veJcGYYsE/Ied0qS40jz+IcpgPGQol745xxul+cLranqXm Zg5cGuoyb1ljGqo0dUHlfPuG2EwPxd4Pn/CinnP9La3YMOdvU7nq8o++wYRNqp1BuB GZQYbGOGx8FWUtY+Zsh5btTKvzvNF9AES8wla0FuKeBrANCkQ3+ixm/XvMiR+Wgusd /RTQO1N9kU+aflLyTq6gJQXwjqhanJVmJPu87tvaVU+WPGSfEgg/dMUz5V9ljdI84B mXBnuew7WmoqA== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 58231CE12D5; Wed, 10 May 2023 10:02:43 -0700 (PDT) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com, rostedt@goodmis.org, "Uladzislau Rezki (Sony)" , "Paul E . McKenney" Subject: [PATCH rcu 6/8] rcu/kvfree: Do not run a page work if a cache is disabled Date: Wed, 10 May 2023 10:02:40 -0700 Message-Id: <20230510170242.2187714-6-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <1c01c38f-3783-44d7-8c11-7416cd5b849c@paulmck-laptop> References: <1c01c38f-3783-44d7-8c11-7416cd5b849c@paulmck-laptop> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: "Uladzislau Rezki (Sony)" By default the cache size is 5 pages per CPU, but it can be disabled at boot time by setting the rcu_min_cached_objs to zero. When that happens, the current code will uselessly set an hrtimer to schedule refilling this cache with zero pages. This commit therefore streamlines this process by simply refusing the set the hrtimer when rcu_min_cached_objs is zero. Signed-off-by: Uladzislau Rezki (Sony) Signed-off-by: Paul E. McKenney --- kernel/rcu/tree.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 51d84eabf645..18f592bf6dc6 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -3225,6 +3225,10 @@ static void fill_page_cache_func(struct work_struct *work) static void run_page_cache_worker(struct kfree_rcu_cpu *krcp) { + // If cache disabled, bail out. + if (!rcu_min_cached_objs) + return; + if (rcu_scheduler_active == RCU_SCHEDULER_RUNNING && !atomic_xchg(&krcp->work_in_progress, 1)) { if (atomic_read(&krcp->backoff_page_cache_fill)) { -- 2.40.1