From: Li Zhijian <zhijianx.li@intel.com>
To: dave@stgolabs.net, joel@joelfernandes.org, josh@joshtriplett.org,
mathieu.desnoyers@efficios.com, paulmck@kernel.org,
rostedt@goodmis.org, rcu@vger.kernel.org
Cc: philip.li@intel.com, lizhijian@cn.fujitsu.com,
jiangshanlai@gmail.com, linux-kernel@vger.kernel.org,
Li Zhijian <zhijianx.li@intel.com>
Subject: [PATCH 6/6] locktorture,rcutorture,torture: always log error message
Date: Fri, 29 Oct 2021 17:40:29 +0800 [thread overview]
Message-ID: <20211029094029.22501-7-zhijianx.li@intel.com> (raw)
In-Reply-To: <20211029094029.22501-1-zhijianx.li@intel.com>
Generally, error message should be logged anyhow.
Signed-off-by: Li Zhijian <zhijianx.li@intel.com>
---
include/linux/torture.h | 9 ++-------
kernel/locking/locktorture.c | 4 ++--
kernel/rcu/rcutorture.c | 8 ++++----
kernel/torture.c | 4 ++--
4 files changed, 10 insertions(+), 15 deletions(-)
diff --git a/include/linux/torture.h b/include/linux/torture.h
index 0910c5803f35..1d2e6c4c38fa 100644
--- a/include/linux/torture.h
+++ b/include/linux/torture.h
@@ -38,13 +38,8 @@ do { \
pr_alert("%s" TORTURE_FLAG " %s\n", torture_type, s); \
} \
} while (0)
-#define VERBOSE_TOROUT_ERRSTRING(s) \
-do { \
- if (verbose) { \
- verbose_torout_sleep(); \
- pr_alert("%s" TORTURE_FLAG "!!! %s\n", torture_type, s); \
- } \
-} while (0)
+#define TOROUT_ERRSTRING(s) \
+ pr_alert("%s" TORTURE_FLAG "!!! %s\n", torture_type, s)
void verbose_torout_sleep(void);
/* Definitions for online/offline exerciser. */
diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c
index 7c5a4a087cc7..6752ce3ac424 100644
--- a/kernel/locking/locktorture.c
+++ b/kernel/locking/locktorture.c
@@ -1047,7 +1047,7 @@ static int __init lock_torture_init(void)
sizeof(writer_tasks[0]),
GFP_KERNEL);
if (writer_tasks == NULL) {
- VERBOSE_TOROUT_ERRSTRING("writer_tasks: Out of memory");
+ TOROUT_ERRSTRING("writer_tasks: Out of memory");
firsterr = -ENOMEM;
goto unwind;
}
@@ -1058,7 +1058,7 @@ static int __init lock_torture_init(void)
sizeof(reader_tasks[0]),
GFP_KERNEL);
if (reader_tasks == NULL) {
- VERBOSE_TOROUT_ERRSTRING("reader_tasks: Out of memory");
+ TOROUT_ERRSTRING("reader_tasks: Out of memory");
kfree(writer_tasks);
writer_tasks = NULL;
firsterr = -ENOMEM;
diff --git a/kernel/rcu/rcutorture.c b/kernel/rcu/rcutorture.c
index ab4215266ebe..9197ce5c7a7d 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -2717,7 +2717,7 @@ static int rcu_torture_read_exit(void *unused)
&trs, "%s",
"rcu_torture_read_exit_child");
if (IS_ERR(tsp)) {
- VERBOSE_TOROUT_ERRSTRING("out of memory");
+ TOROUT_ERRSTRING("out of memory");
errexit = true;
tsp = NULL;
break;
@@ -3044,7 +3044,7 @@ rcu_torture_init(void)
sizeof(fakewriter_tasks[0]),
GFP_KERNEL);
if (fakewriter_tasks == NULL) {
- VERBOSE_TOROUT_ERRSTRING("out of memory");
+ TOROUT_ERRSTRING("out of memory");
firsterr = -ENOMEM;
goto unwind;
}
@@ -3060,7 +3060,7 @@ rcu_torture_init(void)
rcu_torture_reader_mbchk = kcalloc(nrealreaders, sizeof(*rcu_torture_reader_mbchk),
GFP_KERNEL);
if (!reader_tasks || !rcu_torture_reader_mbchk) {
- VERBOSE_TOROUT_ERRSTRING("out of memory");
+ TOROUT_ERRSTRING("out of memory");
firsterr = -ENOMEM;
goto unwind;
}
@@ -3079,7 +3079,7 @@ rcu_torture_init(void)
if (nrealnocbers > 0) {
nocb_tasks = kcalloc(nrealnocbers, sizeof(nocb_tasks[0]), GFP_KERNEL);
if (nocb_tasks == NULL) {
- VERBOSE_TOROUT_ERRSTRING("out of memory");
+ TOROUT_ERRSTRING("out of memory");
firsterr = -ENOMEM;
goto unwind;
}
diff --git a/kernel/torture.c b/kernel/torture.c
index bb8f411c974b..ef27a6c82451 100644
--- a/kernel/torture.c
+++ b/kernel/torture.c
@@ -570,7 +570,7 @@ int torture_shuffle_init(long shuffint)
shuffle_idle_cpu = -1;
if (!alloc_cpumask_var(&shuffle_tmp_mask, GFP_KERNEL)) {
- VERBOSE_TOROUT_ERRSTRING("Failed to alloc mask");
+ TOROUT_ERRSTRING("Failed to alloc mask");
return -ENOMEM;
}
@@ -934,7 +934,7 @@ int _torture_create_kthread(int (*fn)(void *arg), void *arg, char *s, char *m,
*tp = kthread_run(fn, arg, "%s", s);
if (IS_ERR(*tp)) {
ret = PTR_ERR(*tp);
- VERBOSE_TOROUT_ERRSTRING(f);
+ TOROUT_ERRSTRING(f);
*tp = NULL;
}
torture_shuffle_task_register(*tp);
--
2.32.0
next prev parent reply other threads:[~2021-10-29 9:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-29 9:40 [PATCH 0/6] minor fixes and cleanups in rcuscale and torture tests Li Zhijian
2021-10-29 9:40 ` [PATCH 1/6] refscale: add missing '\n' to flush message out Li Zhijian
2021-10-29 9:40 ` [PATCH 2/6] scftorture: " Li Zhijian
2021-10-29 9:40 ` [PATCH 3/6] scftorture: remove unused SCFTORTOUT Li Zhijian
2021-10-29 9:40 ` [PATCH 4/6] scftorture: always log error message Li Zhijian
2021-11-02 16:06 ` Paul E. McKenney
2021-11-03 8:24 ` Li Zhijian
2021-10-29 9:40 ` [PATCH 5/6] rcuscale: alwaly " Li Zhijian
2021-10-29 16:40 ` Davidlohr Bueso
2021-11-02 16:09 ` Paul E. McKenney
2021-10-29 9:40 ` Li Zhijian [this message]
2021-10-29 16:41 ` [PATCH 0/6] minor fixes and cleanups in rcuscale and torture tests Davidlohr Bueso
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=20211029094029.22501-7-zhijianx.li@intel.com \
--to=zhijianx.li@intel.com \
--cc=dave@stgolabs.net \
--cc=jiangshanlai@gmail.com \
--cc=joel@joelfernandes.org \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lizhijian@cn.fujitsu.com \
--cc=mathieu.desnoyers@efficios.com \
--cc=paulmck@kernel.org \
--cc=philip.li@intel.com \
--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;
as well as URLs for NNTP newsgroup(s).