Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp5912409rwp; Mon, 17 Jul 2023 11:24:34 -0700 (PDT) X-Google-Smtp-Source: APBJJlGMlnfe7O+PL85tAbkOQh7fLX5Wea42mUYpGGEWtU43Um1vFeW0EBqKmL5KNBTE0pMmkg/l X-Received: by 2002:a17:906:10cc:b0:98d:e696:de4f with SMTP id v12-20020a17090610cc00b0098de696de4fmr193983ejv.26.1689618274306; Mon, 17 Jul 2023 11:24:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689618274; cv=none; d=google.com; s=arc-20160816; b=hO4a2AfDWgHhthHtUDhxi/6Cs1rVG+CZtgX4Z3xiDYB9AVcaC6G5MnVoUC/DE5Baxs X2McbW1uSYk4FHY2pRvm0RTn4abERlirL0YuXhg5s6NgvN6Te1BSlE8aIiuvOE+33OI8 RWmq6w9xdEdBB/WZxH+WWoLBePtBywfeVN5EFaELgP7u8OUfRtDxp6JczZwaMDOFyL8G J0M8d8iweX6fLLApuObsQfe4YvmYfwg6znon20hHi1o7LH2QELnHGhfrh5oxIlIIEgGD as27URtZzWaaLKoDokxWJUHymKjU5BHxBHD8AG0xbxg+wTG4+DgjLd2TsYVWyjq9nWsS mXbA== 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=SVZNdWoMDr3r5JL/SntFK+w+LlBg4HPyNRpEYPla1IU=; fh=Ag0RbRk3LxdpQ9OdMLAf8hbnmFe6FOAHRGAvgVTwgEc=; b=XJu9DiyrtyQfw57gjFCeiG6bpiXLFJB4Y1gZi7xq9rBU9DVn3asfIkLkbi5hjs/5eE MjJoBl6HPmpXXRzLeGZNZUWOS51H0bizInhny3SKT13cOrTH55FPdcqWeMpI0rF3BP9f zjuAWlW9K19EbEtOXEMvMhiSTLcemeJPUgV1IQBU86gHZ1gTKtY22H4LLkwtr61O8Sk8 mC5YnBm41z+IYrFTxH1z/Jf9o8/KC9F4Xr1S8AHEbJobFIwDAgBuIHx4Ka11ahVihxK3 1Pj8Lc4YUXRniYb73aCXE+J118+h9rji4oYLCrP/ffy5lkFAQB5VychSr1P56DUnKq8X PCSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YR9mNJCG; 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 ch7-20020a170906c2c700b00993689daad0si18432ejb.269.2023.07.17.11.24.10; Mon, 17 Jul 2023 11:24:34 -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=YR9mNJCG; 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 S231157AbjGQSLo (ORCPT + 99 others); Mon, 17 Jul 2023 14:11:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230397AbjGQSLm (ORCPT ); Mon, 17 Jul 2023 14:11:42 -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 01E94E4C; Mon, 17 Jul 2023 11:11:40 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8CA41611DD; Mon, 17 Jul 2023 18:11:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE024C433CB; Mon, 17 Jul 2023 18:11:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689617500; bh=5A8xH+p0dUJfvye10KzRYh4lPe5RZ2TL4tDrfKR9vx0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YR9mNJCGa0lEX1MzLzlunbCdKEny04LHyl33ZVfu9iRO9pZCmmCmnU10FIauKD17c AtzN4soQXUTe95wjeMRaMPYEV/S60XPyr6B9s56DgbpIoKFWqhxs66n1ahizdjbdZh GaN8eP4mQZxC77NlCVHCWQA9X4e4i1cXjCV0Np+epPYBxwNkZDPBXy3Uys0JE9xbFy KNCebj0ugbDIo/ddKrtLLaaNqe0r3Al6QFlocxTg6okZRC/YyckNdI+PQAAhdV4Lir u1xNATbnZV5cIUtEj/6UrpvQ20KTb+xGEF1ZUej7pK0S1d/M+FnHTBaXSxj6ZkKVMz x+RUyCjNqOkrQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id AD68BCE03F1; Mon, 17 Jul 2023 11:11:39 -0700 (PDT) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com, rostedt@goodmis.org, "Paul E. McKenney" Subject: [PATCH rcu 01/13] rcuscale: Permit blocking delays between writers Date: Mon, 17 Jul 2023 11:11:26 -0700 Message-Id: <20230717181138.1098063-1-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: References: 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 Some workloads do isolated RCU work, and this can affect operation latencies. This commit therefore adds a writer_holdoff_jiffies module parameter that causes writers to block for the specified number of jiffies between each pair of consecutive write-side operations. Signed-off-by: Paul E. McKenney --- Documentation/admin-guide/kernel-parameters.txt | 5 +++++ kernel/rcu/rcuscale.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index a1457995fd41..5ba231b786f8 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -4983,6 +4983,11 @@ in microseconds. The default of zero says no holdoff. + rcuscale.writer_holdoff_jiffies= [KNL] + Additional write-side holdoff between grace + periods, but in jiffies. The default of zero + says no holdoff. + rcutorture.fqs_duration= [KNL] Set duration of force_quiescent_state bursts in microseconds. diff --git a/kernel/rcu/rcuscale.c b/kernel/rcu/rcuscale.c index d1221731c7cf..4277037e0996 100644 --- a/kernel/rcu/rcuscale.c +++ b/kernel/rcu/rcuscale.c @@ -93,6 +93,7 @@ torture_param(bool, shutdown, RCUSCALE_SHUTDOWN, "Shutdown at end of scalability tests."); torture_param(int, verbose, 1, "Enable verbose debugging printk()s"); torture_param(int, writer_holdoff, 0, "Holdoff (us) between GPs, zero to disable"); +torture_param(int, writer_holdoff_jiffies, 0, "Holdoff (jiffies) between GPs, zero to disable"); torture_param(int, kfree_rcu_test, 0, "Do we run a kfree_rcu() scale test?"); torture_param(int, kfree_mult, 1, "Multiple of kfree_obj size to allocate."); torture_param(int, kfree_by_call_rcu, 0, "Use call_rcu() to emulate kfree_rcu()?"); @@ -414,6 +415,7 @@ rcu_scale_writer(void *arg) struct rcu_head *rhp = NULL; bool started = false, done = false, alldone = false; u64 t; + DEFINE_TORTURE_RANDOM(tr); u64 *wdp; u64 *wdpp = writer_durations[me]; @@ -448,6 +450,8 @@ rcu_scale_writer(void *arg) do { if (writer_holdoff) udelay(writer_holdoff); + if (writer_holdoff_jiffies) + schedule_timeout_idle(torture_random(&tr) % writer_holdoff_jiffies + 1); wdp = &wdpp[i]; *wdp = ktime_get_mono_fast_ns(); if (gp_async) { -- 2.40.1