* [PATCH 2/3] rcuperf: Insert space between flag and message consistently
2016-08-21 7:54 [PATCH 1/3] rcuperf: Remove unnecessary rcu_perf_writer_state variable SeongJae Park
@ 2016-08-21 7:54 ` SeongJae Park
2016-08-21 7:54 ` [PATCH 3/3] torture: TOROUT_STRING(): Insert a space between flag and message SeongJae Park
2016-08-21 23:00 ` [PATCH 1/3] rcuperf: Remove unnecessary rcu_perf_writer_state variable Paul E. McKenney
2 siblings, 0 replies; 4+ messages in thread
From: SeongJae Park @ 2016-08-21 7:54 UTC (permalink / raw)
To: paulmck; +Cc: linux-kernel, SeongJae Park
Few output messages of rcuperf has no space between flag and start of
message while every other messages keeps a space consistently. It makes
output messages to be inconsistent and weird especially when it be read
by dmesg with color option enabled. This commit fixes the problem by
modifying a pr_alert() call and PERFOUT_STRING() macro function.
Signed-off-by: SeongJae Park <sj38.park@gmail.com>
---
kernel/rcu/rcuperf.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/kernel/rcu/rcuperf.c b/kernel/rcu/rcuperf.c
index 6025342..03ba447 100644
--- a/kernel/rcu/rcuperf.c
+++ b/kernel/rcu/rcuperf.c
@@ -52,7 +52,7 @@ MODULE_AUTHOR("Paul E. McKenney <paulmck@linux.vnet.ibm.com>");
#define PERF_FLAG "-perf:"
#define PERFOUT_STRING(s) \
- pr_alert("%s" PERF_FLAG s "\n", perf_type)
+ pr_alert("%s" PERF_FLAG " %s\n", perf_type, s)
#define VERBOSE_PERFOUT_STRING(s) \
do { if (verbose) pr_alert("%s" PERF_FLAG " %s\n", perf_type, s); } while (0)
#define VERBOSE_PERFOUT_ERRSTRING(s) \
@@ -389,9 +389,8 @@ rcu_perf_writer(void *arg)
sp.sched_priority = 0;
sched_setscheduler_nocheck(current,
SCHED_NORMAL, &sp);
- pr_alert("%s" PERF_FLAG
- "rcu_perf_writer %ld has %d measurements\n",
- perf_type, me, MIN_MEAS);
+ pr_alert("%s%s rcu_perf_writer %ld has %d measurements\n",
+ perf_type, PERF_FLAG, me, MIN_MEAS);
if (atomic_inc_return(&n_rcu_perf_writer_finished) >=
nrealwriters) {
schedule_timeout_interruptible(10);
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH 3/3] torture: TOROUT_STRING(): Insert a space between flag and message
2016-08-21 7:54 [PATCH 1/3] rcuperf: Remove unnecessary rcu_perf_writer_state variable SeongJae Park
2016-08-21 7:54 ` [PATCH 2/3] rcuperf: Insert space between flag and message consistently SeongJae Park
@ 2016-08-21 7:54 ` SeongJae Park
2016-08-21 23:00 ` [PATCH 1/3] rcuperf: Remove unnecessary rcu_perf_writer_state variable Paul E. McKenney
2 siblings, 0 replies; 4+ messages in thread
From: SeongJae Park @ 2016-08-21 7:54 UTC (permalink / raw)
To: paulmck; +Cc: linux-kernel, SeongJae Park
TOROUT_STRING() macro function does not insert a space between flag and
message while other similar couterparts do. The output will be
inconsistent and weird especially when it is read by dmesg with color
option enabled. This commit adds an space between flag and message in
TOROUT_STRING() output.
Signed-off-by: SeongJae Park <sj38.park@gmail.com>
---
include/linux/torture.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/torture.h b/include/linux/torture.h
index 6685a73..a45702e 100644
--- a/include/linux/torture.h
+++ b/include/linux/torture.h
@@ -43,7 +43,7 @@
#define TORTURE_FLAG "-torture:"
#define TOROUT_STRING(s) \
- pr_alert("%s" TORTURE_FLAG s "\n", torture_type)
+ pr_alert("%s" TORTURE_FLAG " %s\n", torture_type, s)
#define VERBOSE_TOROUT_STRING(s) \
do { if (verbose) pr_alert("%s" TORTURE_FLAG " %s\n", torture_type, s); } while (0)
#define VERBOSE_TOROUT_ERRSTRING(s) \
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH 1/3] rcuperf: Remove unnecessary rcu_perf_writer_state variable
2016-08-21 7:54 [PATCH 1/3] rcuperf: Remove unnecessary rcu_perf_writer_state variable SeongJae Park
2016-08-21 7:54 ` [PATCH 2/3] rcuperf: Insert space between flag and message consistently SeongJae Park
2016-08-21 7:54 ` [PATCH 3/3] torture: TOROUT_STRING(): Insert a space between flag and message SeongJae Park
@ 2016-08-21 23:00 ` Paul E. McKenney
2 siblings, 0 replies; 4+ messages in thread
From: Paul E. McKenney @ 2016-08-21 23:00 UTC (permalink / raw)
To: SeongJae Park; +Cc: linux-kernel
On Sun, Aug 21, 2016 at 04:54:38PM +0900, SeongJae Park wrote:
> rcu_perf_writer_state is being written only while nobody reads it. This
> commit removes the unnecessary variable and macro constants for it.
>
> Signed-off-by: SeongJae Park <sj38.park@gmail.com>
> ---
I am keeping rcu_perf_writer_state for debugging purposes, but I pulled
in the other two patches for review and testing, thank you!
Thanx, Paul
> kernel/rcu/rcuperf.c | 16 ++--------------
> 1 file changed, 2 insertions(+), 14 deletions(-)
>
> diff --git a/kernel/rcu/rcuperf.c b/kernel/rcu/rcuperf.c
> index d38ab08..6025342 100644
> --- a/kernel/rcu/rcuperf.c
> +++ b/kernel/rcu/rcuperf.c
> @@ -86,13 +86,6 @@ static u64 t_rcu_perf_writer_finished;
> static unsigned long b_rcu_perf_writer_started;
> static unsigned long b_rcu_perf_writer_finished;
>
> -static int rcu_perf_writer_state;
> -#define RTWS_INIT 0
> -#define RTWS_EXP_SYNC 1
> -#define RTWS_SYNC 2
> -#define RTWS_IDLE 2
> -#define RTWS_STOPPING 3
> -
> #define MAX_MEAS 10000
> #define MIN_MEAS 100
>
> @@ -381,14 +374,10 @@ rcu_perf_writer(void *arg)
> do {
> wdp = &wdpp[i];
> *wdp = ktime_get_mono_fast_ns();
> - if (gp_exp) {
> - rcu_perf_writer_state = RTWS_EXP_SYNC;
> + if (gp_exp)
> cur_ops->exp_sync();
> - } else {
> - rcu_perf_writer_state = RTWS_SYNC;
> + else
> cur_ops->sync();
> - }
> - rcu_perf_writer_state = RTWS_IDLE;
> t = ktime_get_mono_fast_ns();
> *wdp = t - *wdp;
> i_max = i;
> @@ -429,7 +418,6 @@ rcu_perf_writer(void *arg)
> i++;
> rcu_perf_wait_shutdown();
> } while (!torture_must_stop());
> - rcu_perf_writer_state = RTWS_STOPPING;
> writer_n_durations[me] = i_max;
> torture_kthread_stopping("rcu_perf_writer");
> return 0;
> --
> 1.9.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread