From: Zqiang <qiang.zhang1211@gmail.com>
To: paulmck@kernel.org, frederic@kernel.org, joel@joelfernandes.org
Cc: qiang.zhang1211@gmail.com, rcu@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] rcutorture: Add fqs_holdoff check before the fqs_task is created
Date: Fri, 3 Nov 2023 15:26:39 +0800 [thread overview]
Message-ID: <20231103072639.11426-1-qiang.zhang1211@gmail.com> (raw)
For rcutorture tests that support fqs operations and set fqs_duration
greater than zero, the fqs_task kthread will be created. but if the
fqs_holdoff is not set, the default value is zero, this cause fqs_task
enter a long-term busy loop and won't voluntarily give up the CPU until
stopped by kthread_stop(). this commit therefore add for fqs_holdoff check
before the fqs_task is created, make sure the fqs_task is created when
the fqs_holdoff is also greater than zero.
Signed-off-by: Zqiang <qiang.zhang1211@gmail.com>
---
kernel/rcu/rcutorture.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index 83999e57b3ea..9f0e6c1cad44 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -3886,7 +3886,9 @@ rcu_torture_init(void)
}
if (fqs_duration < 0)
fqs_duration = 0;
- if (fqs_duration) {
+ if (fqs_holdoff < 0)
+ fqs_holdoff = 0;
+ if (fqs_duration && fqs_holdoff) {
/* Create the fqs thread */
firsterr = torture_create_kthread(rcu_torture_fqs, NULL,
fqs_task);
--
2.17.1
next reply other threads:[~2023-11-03 7:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-03 7:26 Zqiang [this message]
2023-11-03 15:50 ` [PATCH] rcutorture: Add fqs_holdoff check before the fqs_task is created Z qiang
2023-11-03 21:13 ` 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=20231103072639.11426-1-qiang.zhang1211@gmail.com \
--to=qiang.zhang1211@gmail.com \
--cc=frederic@kernel.org \
--cc=joel@joelfernandes.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@kernel.org \
--cc=rcu@vger.kernel.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).