* [tip: core/rcu] locktorture: Ignore nreaders_stress if no readlock support
@ 2020-12-13 19:01 tip-bot2 for Hou Tao
0 siblings, 0 replies; only message in thread
From: tip-bot2 for Hou Tao @ 2020-12-13 19:01 UTC (permalink / raw)
To: linux-tip-commits; +Cc: Hou Tao, Paul E. McKenney, x86, linux-kernel
The following commit has been merged into the core/rcu branch of tip:
Commit-ID: e5ace37d83af459bd491847df570b6763c602344
Gitweb: https://git.kernel.org/tip/e5ace37d83af459bd491847df570b6763c602344
Author: Hou Tao <houtao1@huawei.com>
AuthorDate: Fri, 18 Sep 2020 19:44:24 +08:00
Committer: Paul E. McKenney <paulmck@kernel.org>
CommitterDate: Fri, 06 Nov 2020 17:13:52 -08:00
locktorture: Ignore nreaders_stress if no readlock support
Exclusive locks do not have readlock support, which means that a
locktorture run with the following module parameters will do nothing:
torture_type=mutex_lock nwriters_stress=0 nreaders_stress=1
This commit therefore rejects this combination for exclusive locks by
returning -EINVAL during module init.
Signed-off-by: Hou Tao <houtao1@huawei.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
---
kernel/locking/locktorture.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c
index 316531d..046ea2d 100644
--- a/kernel/locking/locktorture.c
+++ b/kernel/locking/locktorture.c
@@ -870,7 +870,8 @@ static int __init lock_torture_init(void)
goto unwind;
}
- if (nwriters_stress == 0 && nreaders_stress == 0) {
+ if (nwriters_stress == 0 &&
+ (!cxt.cur_ops->readlock || nreaders_stress == 0)) {
pr_alert("lock-torture: must run at least one locking thread\n");
firsterr = -EINVAL;
goto unwind;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-12-13 19:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-13 19:01 [tip: core/rcu] locktorture: Ignore nreaders_stress if no readlock support tip-bot2 for Hou Tao
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 NNTP newsgroup(s).