All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] scftorture: Always log error message
@ 2021-11-03  8:30 Li Zhijian
  2021-11-03  8:30 ` [PATCH v2 2/2] locktorture,rcutorture,torture: " Li Zhijian
  2021-11-03 18:05 ` [PATCH v2 1/2] scftorture: " Paul E. McKenney
  0 siblings, 2 replies; 3+ messages in thread
From: Li Zhijian @ 2021-11-03  8:30 UTC (permalink / raw)
  To: paulmck, rcu
  Cc: linux-kernel, lizhijian, philip.li, Li Zhijian, Davidlohr Bueso

Unconditionally log messages corresponding to errors.

Acked-by: Davidlohr Bueso <dbueso@suse.de>
Signed-off-by: Li Zhijian <zhijianx.li@intel.com>

---
V2: rebase against rcu tree
---
 kernel/scftorture.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/kernel/scftorture.c b/kernel/scftorture.c
index a0df767897a1..dcb0410950e4 100644
--- a/kernel/scftorture.c
+++ b/kernel/scftorture.c
@@ -41,8 +41,7 @@
 #define VERBOSE_SCFTORTOUT(s, x...) \
 	do { if (verbose) pr_alert(SCFTORT_FLAG s "\n", ## x); } while (0)
 
-#define VERBOSE_SCFTORTOUT_ERRSTRING(s, x...) \
-	do { if (verbose) pr_alert(SCFTORT_FLAG "!!! " s "\n", ## x); } while (0)
+#define SCFTORTOUT_ERRSTRING(s, x...) pr_alert(SCFTORT_FLAG "!!! " s "\n", ## x)
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Paul E. McKenney <paulmck@kernel.org>");
@@ -584,14 +583,14 @@ static int __init scf_torture_init(void)
 	if (weight_resched1 == 0 && weight_single1 == 0 && weight_single_rpc1 == 0 &&
 	    weight_single_wait1 == 0 && weight_many1 == 0 && weight_many_wait1 == 0 &&
 	    weight_all1 == 0 && weight_all_wait1 == 0) {
-		VERBOSE_SCFTORTOUT_ERRSTRING("all zero weights makes no sense");
+		SCFTORTOUT_ERRSTRING("all zero weights makes no sense");
 		firsterr = -EINVAL;
 		goto unwind;
 	}
 	if (IS_BUILTIN(CONFIG_SCF_TORTURE_TEST))
 		scf_sel_add(weight_resched1, SCF_PRIM_RESCHED, false);
 	else if (weight_resched1)
-		VERBOSE_SCFTORTOUT_ERRSTRING("built as module, weight_resched ignored");
+		SCFTORTOUT_ERRSTRING("built as module, weight_resched ignored");
 	scf_sel_add(weight_single1, SCF_PRIM_SINGLE, false);
 	scf_sel_add(weight_single_rpc1, SCF_PRIM_SINGLE_RPC, true);
 	scf_sel_add(weight_single_wait1, SCF_PRIM_SINGLE, true);
@@ -622,7 +621,7 @@ static int __init scf_torture_init(void)
 		nthreads = num_online_cpus();
 	scf_stats_p = kcalloc(nthreads, sizeof(scf_stats_p[0]), GFP_KERNEL);
 	if (!scf_stats_p) {
-		VERBOSE_SCFTORTOUT_ERRSTRING("out of memory");
+		SCFTORTOUT_ERRSTRING("out of memory");
 		firsterr = -ENOMEM;
 		goto unwind;
 	}
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH v2 2/2] locktorture,rcutorture,torture: Always log error message
  2021-11-03  8:30 [PATCH v2 1/2] scftorture: Always log error message Li Zhijian
@ 2021-11-03  8:30 ` Li Zhijian
  2021-11-03 18:05 ` [PATCH v2 1/2] scftorture: " Paul E. McKenney
  1 sibling, 0 replies; 3+ messages in thread
From: Li Zhijian @ 2021-11-03  8:30 UTC (permalink / raw)
  To: paulmck, rcu
  Cc: linux-kernel, lizhijian, philip.li, Li Zhijian, Davidlohr Bueso

Unconditionally log messages corresponding to errors.

Acked-by: Davidlohr Bueso <dbueso@suse.de>
Signed-off-by: Li Zhijian <zhijianx.li@intel.com>

---
V2: rebase against rcu tree
---
 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 24f58e50a94b..63fa4196e51c 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);
 
 #define torture_init_error(firsterr)						\
diff --git a/kernel/locking/locktorture.c b/kernel/locking/locktorture.c
index 397ac13d2ef7..9c2fb613a55d 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 503e14e62e8f..36a273589a35 100644
--- a/kernel/rcu/rcutorture.c
+++ b/kernel/rcu/rcutorture.c
@@ -2774,7 +2774,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;
@@ -3101,7 +3101,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;
 		}
@@ -3117,7 +3117,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;
 	}
@@ -3136,7 +3136,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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 1/2] scftorture: Always log error message
  2021-11-03  8:30 [PATCH v2 1/2] scftorture: Always log error message Li Zhijian
  2021-11-03  8:30 ` [PATCH v2 2/2] locktorture,rcutorture,torture: " Li Zhijian
@ 2021-11-03 18:05 ` Paul E. McKenney
  1 sibling, 0 replies; 3+ messages in thread
From: Paul E. McKenney @ 2021-11-03 18:05 UTC (permalink / raw)
  To: Li Zhijian; +Cc: rcu, linux-kernel, lizhijian, philip.li, Davidlohr Bueso

On Wed, Nov 03, 2021 at 04:30:27PM +0800, Li Zhijian wrote:
> Unconditionally log messages corresponding to errors.
> 
> Acked-by: Davidlohr Bueso <dbueso@suse.de>
> Signed-off-by: Li Zhijian <zhijianx.li@intel.com>

I have queued both for the v5.17 (not current, but next) merge window.
Thank you!

							Thanx, Paul

> ---
> V2: rebase against rcu tree
> ---
>  kernel/scftorture.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/kernel/scftorture.c b/kernel/scftorture.c
> index a0df767897a1..dcb0410950e4 100644
> --- a/kernel/scftorture.c
> +++ b/kernel/scftorture.c
> @@ -41,8 +41,7 @@
>  #define VERBOSE_SCFTORTOUT(s, x...) \
>  	do { if (verbose) pr_alert(SCFTORT_FLAG s "\n", ## x); } while (0)
>  
> -#define VERBOSE_SCFTORTOUT_ERRSTRING(s, x...) \
> -	do { if (verbose) pr_alert(SCFTORT_FLAG "!!! " s "\n", ## x); } while (0)
> +#define SCFTORTOUT_ERRSTRING(s, x...) pr_alert(SCFTORT_FLAG "!!! " s "\n", ## x)
>  
>  MODULE_LICENSE("GPL");
>  MODULE_AUTHOR("Paul E. McKenney <paulmck@kernel.org>");
> @@ -584,14 +583,14 @@ static int __init scf_torture_init(void)
>  	if (weight_resched1 == 0 && weight_single1 == 0 && weight_single_rpc1 == 0 &&
>  	    weight_single_wait1 == 0 && weight_many1 == 0 && weight_many_wait1 == 0 &&
>  	    weight_all1 == 0 && weight_all_wait1 == 0) {
> -		VERBOSE_SCFTORTOUT_ERRSTRING("all zero weights makes no sense");
> +		SCFTORTOUT_ERRSTRING("all zero weights makes no sense");
>  		firsterr = -EINVAL;
>  		goto unwind;
>  	}
>  	if (IS_BUILTIN(CONFIG_SCF_TORTURE_TEST))
>  		scf_sel_add(weight_resched1, SCF_PRIM_RESCHED, false);
>  	else if (weight_resched1)
> -		VERBOSE_SCFTORTOUT_ERRSTRING("built as module, weight_resched ignored");
> +		SCFTORTOUT_ERRSTRING("built as module, weight_resched ignored");
>  	scf_sel_add(weight_single1, SCF_PRIM_SINGLE, false);
>  	scf_sel_add(weight_single_rpc1, SCF_PRIM_SINGLE_RPC, true);
>  	scf_sel_add(weight_single_wait1, SCF_PRIM_SINGLE, true);
> @@ -622,7 +621,7 @@ static int __init scf_torture_init(void)
>  		nthreads = num_online_cpus();
>  	scf_stats_p = kcalloc(nthreads, sizeof(scf_stats_p[0]), GFP_KERNEL);
>  	if (!scf_stats_p) {
> -		VERBOSE_SCFTORTOUT_ERRSTRING("out of memory");
> +		SCFTORTOUT_ERRSTRING("out of memory");
>  		firsterr = -ENOMEM;
>  		goto unwind;
>  	}
> -- 
> 2.32.0
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-11-03 18:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-03  8:30 [PATCH v2 1/2] scftorture: Always log error message Li Zhijian
2021-11-03  8:30 ` [PATCH v2 2/2] locktorture,rcutorture,torture: " Li Zhijian
2021-11-03 18:05 ` [PATCH v2 1/2] scftorture: " Paul E. McKenney

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.