Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp640270rwd; Wed, 31 May 2023 03:24:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5DxfLQJbUaAgOtcEb4a+zTdqiVvKomIJiQk4/dTuyvE1kx21j1lIrVIUkwov1dwIcISzp+ X-Received: by 2002:a05:6808:150c:b0:395:dd8c:f852 with SMTP id u12-20020a056808150c00b00395dd8cf852mr3903855oiw.42.1685528670987; Wed, 31 May 2023 03:24:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685528670; cv=none; d=google.com; s=arc-20160816; b=d1G/Y1mYNYvuUUzPRoR3u0/qTUIiwnt+D9DHIhbb+y7iSDqjpHXYizUeohFQwwzUbZ SSWfGvhGKJLn5Bn0peOZ7y27emJhkWY09xg/sHne8nDySjNmTdXVUCRlshynvIhedsew in1I9pmy7BxTlYI+naZlNGylL1BNUYECfbOUfS4nf5Dd3vTLlGm59BUJmIwEp0Eo1Pr+ ZiwN2cQPf2zpEKd9PsFy6x01jXrbqQsQ64E7FU2cxF8thOUeWy4F7q77+NIlXkLuJ5bv CdDF985gT8raBAn5m6o6dHbIwnQvwgKkUdP4cDLhSLBFv1cdO4uGsx4vp0uleXDAlQwX KCbA== 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=mkaAhEe/SW0QZ/2QsybNqgtHrErP4zqnWfm8/Io+114=; b=mCumCLn8sV7SEYk+2rVqCs2Ai2t4qgHwoVPPmDRawCVweUy9p7uapmkO6mv0XQkIDO pz9iBY5z3GiX6VosX2/7ip6cqZpx0uZcVCHbima4HaTZXznMhdYOvUdLyDg6oeRkRZ4c qw4K0f6sZ55uTmk2QXqOnQnJUuupUsmuvptKztc09zc2Ysh/atkWKlIASEtm1bR3hanz 2A/b3tiHkXeKf83MIcIK06K6pC6C+cR21IAhlA5u4/r0XbynJInWavdJPnAEzeV7fyEF xdcUfMTFh/5TKF4M/L/wcOQGqdAwwjRep1wVSMIwH03joCtpTQQ6O5WhqB/3fh+94fOm h1Hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fkVWQNRt; 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 j12-20020a633c0c000000b00534866eb2c2si698901pga.835.2023.05.31.03.24.17; Wed, 31 May 2023 03:24:30 -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=fkVWQNRt; 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 S235905AbjEaKSQ (ORCPT + 99 others); Wed, 31 May 2023 06:18:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235400AbjEaKSE (ORCPT ); Wed, 31 May 2023 06:18:04 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20D2A192; Wed, 31 May 2023 03:18:02 -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 9198263082; Wed, 31 May 2023 10:18:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E23F9C4339E; Wed, 31 May 2023 10:17:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685528281; bh=6T9PufNrI67qOiSAF/52EuU4TI9tRCG4o5fvW1OJc0o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fkVWQNRtlxpcY2As9Q6qfsRTeQjdEIWbYSQED2VojPxVw3Go3BxDgEygTzHVsXAPY vXAHatJvEKVf3WwQP/uVflw/CEm1YR8Y44zPhSDTF1YCHNs9AEBVv9INEEGPFJ6jvL 0lSvKiNs/LQu9yizqC2Ds7ofvQKu3LuR9qJtjjOZW+FfcXTdaCank7nF/KbcpxDpyC 0FmT8Yxn4/SHANswoBqJt6X5uJkikVf5sS4p95CtRygTzKqwrguM55LImEEUtlDyZN 6pSbSuzgNYerqlI9BeJNsnEik5g0ADjWEzopCq6tqJF9GaOtukav31+Fi2lmh5pfe0 YQSpi/Aq0ayPw== From: Frederic Weisbecker To: "Paul E . McKenney" Cc: LKML , Frederic Weisbecker , rcu , Uladzislau Rezki , Neeraj Upadhyay , Joel Fernandes , Giovanni Gherdovich Subject: [PATCH 5/9] rcu: Add rcutree.lazy_enabled boot parameter Date: Wed, 31 May 2023 12:17:32 +0200 Message-Id: <20230531101736.12981-6-frederic@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230531101736.12981-1-frederic@kernel.org> References: <20230531101736.12981-1-frederic@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.3 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,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 Allow to overwrite the arbitrary default number of lazy callbacks threshold that is currently set to 100. This allows for tuning between powersaving, throughtput and memory consumption expectations. As a bonus, setting this value to 0 disables lazy callbacks. Signed-off-by: Frederic Weisbecker --- Documentation/admin-guide/kernel-parameters.txt | 5 +++++ kernel/rcu/tree.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 505978cfb548..dd2be4249061 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -4798,6 +4798,11 @@ Set threshold of queued RCU callbacks beyond which batch limiting is disabled. + rcutree.qhimark_lazy = [KNL] + Set threshold of queued lazy RCU callbacks beyond which + batch must be flushed to the main queue. If set to 0, + disable lazy queue. + rcutree.qlowmark= [KNL] Set threshold of queued RCU callbacks below which batch limiting is re-enabled. diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 9b98d87fa22e..e33c0d889216 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -390,6 +390,7 @@ static long qovld_calc = -1; // No pre-initialization lock acquisitions! module_param(blimit, long, 0444); module_param(qhimark, long, 0444); +module_param(qhimark_lazy, long, 0444); module_param(qlowmark, long, 0444); module_param(qovld, long, 0444); @@ -2655,7 +2656,7 @@ __call_rcu_common(struct rcu_head *head, rcu_callback_t func, bool lazy_in) kasan_record_aux_stack_noalloc(head); local_irq_save(flags); rdp = this_cpu_ptr(&rcu_data); - lazy = lazy_in && !rcu_async_should_hurry(); + lazy = lazy_in && qhimark_lazy && !rcu_async_should_hurry(); /* Add the callback to our list. */ if (unlikely(!rcu_segcblist_is_enabled(&rdp->cblist))) { -- 2.40.1