mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@kernel.org>
To: rcu@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, kernel-team@meta.com,
	rostedt@goodmis.org, "Paul E. McKenney" <paulmck@kernel.org>
Subject: [PATCH rcu 03/13] rcuscale: Add minruntime module parameter
Date: Mon, 17 Jul 2023 11:11:28 -0700	[thread overview]
Message-ID: <20230717181138.1098063-3-paulmck@kernel.org> (raw)
In-Reply-To: <c5a593d3-abe0-40fd-92bd-28d269042aa1@paulmck-laptop>

By default, rcuscale collects only 100 points of data per writer, but
arranging for all kthreads to be actively collecting (if not recording)
data during the time that any kthread might be recording.  This works
well, but does not allow much time to bring external performance tools
to bear.  This commit therefore adds a minruntime module parameter
that specifies a minimum data-collection interval in seconds.

Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
---
 Documentation/admin-guide/kernel-parameters.txt | 6 ++++++
 kernel/rcu/rcuscale.c                           | 5 ++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index 5ba231b786f8..a6888e3dfc20 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -4953,6 +4953,12 @@
 			Number of loops doing rcuscale.kfree_alloc_num number
 			of allocations and frees.
 
+	rcuscale.minruntime= [KNL]
+			Set the minimum test run time in seconds.  This
+			does not affect the data-collection interval,
+			but instead allows better measurement of things
+			like CPU consumption.
+
 	rcuscale.nreaders= [KNL]
 			Set number of RCU readers.  The value -1 selects
 			N, where N is the number of CPUs.  A value
diff --git a/kernel/rcu/rcuscale.c b/kernel/rcu/rcuscale.c
index 15edd8c82933..7c5bab5a4f19 100644
--- a/kernel/rcu/rcuscale.c
+++ b/kernel/rcu/rcuscale.c
@@ -87,6 +87,7 @@ torture_param(bool, gp_async, false, "Use asynchronous GP wait primitives");
 torture_param(int, gp_async_max, 1000, "Max # outstanding waits per writer");
 torture_param(bool, gp_exp, false, "Use expedited GP wait primitives");
 torture_param(int, holdoff, 10, "Holdoff time before test start (s)");
+torture_param(int, minruntime, 0, "Minimum run time (s)");
 torture_param(int, nreaders, -1, "Number of RCU reader threads");
 torture_param(int, nwriters, -1, "Number of RCU updater threads");
 torture_param(bool, shutdown, RCUSCALE_SHUTDOWN,
@@ -411,6 +412,7 @@ rcu_scale_writer(void *arg)
 {
 	int i = 0;
 	int i_max;
+	unsigned long jdone;
 	long me = (long)arg;
 	struct rcu_head *rhp = NULL;
 	bool started = false, done = false, alldone = false;
@@ -447,6 +449,7 @@ rcu_scale_writer(void *arg)
 		}
 	}
 
+	jdone = jiffies + minruntime * HZ;
 	do {
 		if (writer_holdoff)
 			udelay(writer_holdoff);
@@ -479,7 +482,7 @@ rcu_scale_writer(void *arg)
 		if (!started &&
 		    atomic_read(&n_rcu_scale_writer_started) >= nrealwriters)
 			started = true;
-		if (!done && i >= MIN_MEAS) {
+		if (!done && i >= MIN_MEAS && time_after(jiffies, jdone)) {
 			done = true;
 			sched_set_normal(current, 0);
 			pr_alert("%s%s rcu_scale_writer %ld has %d measurements\n",
-- 
2.40.1


  parent reply	other threads:[~2023-07-17 18:11 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-17 18:08 [PATCH rcu 0/13] RCU update-side scalability test updates for v6.6 Paul E. McKenney
2023-07-17 18:11 ` [PATCH rcu 01/13] rcuscale: Permit blocking delays between writers Paul E. McKenney
2023-07-17 18:11 ` [PATCH rcu 02/13] rcuscale: Fix gp_async_max typo: s/reader/writer/ Paul E. McKenney
2023-07-17 18:11 ` Paul E. McKenney [this message]
2023-07-17 18:11 ` [PATCH rcu 04/13] rcuscale: Print out full set of module parameters Paul E. McKenney
2023-07-17 18:11 ` [PATCH rcu 05/13] rcuscale: Print out full set of kfree_rcu parameters Paul E. McKenney
2023-07-17 18:11 ` [PATCH rcu 06/13] rcuscale: Measure grace-period kthread CPU time Paul E. McKenney
2023-07-17 18:11 ` [PATCH rcu 07/13] rcuscale: Add kfree_by_call_rcu and kfree_mult to documentation Paul E. McKenney
2023-07-17 18:11 ` [PATCH rcu 08/13] rcuscale: Print grace-period kthread CPU time, if recorded Paul E. McKenney
2023-07-17 18:11 ` [PATCH rcu 09/13] rcuscale: Measure RCU Tasks Trace grace-period kthread CPU time Paul E. McKenney
2023-07-17 18:11 ` [PATCH rcu 10/13] rcuscale: Add RCU Tasks Rude testing Paul E. McKenney
2023-07-17 18:11 ` [PATCH rcu 11/13] rcuscale: fix building with RCU_TINY Paul E. McKenney
2023-07-17 18:11 ` [PATCH rcu 12/13] rcuscale: Move rcu_scale_writer() schedule_timeout_uninterruptible() to _idle() Paul E. McKenney
2023-07-17 18:11 ` [PATCH rcu 13/13] rcuscale: Add CONFIG_PREEMPT_DYNAMIC=n to TRACE01 scenario Paul E. McKenney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230717181138.1098063-3-paulmck@kernel.org \
    --to=paulmck@kernel.org \
    --cc=kernel-team@meta.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rcu@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®