2021-10-29 09:43:45

by Li Zhijian

[permalink] [raw]
Subject: [PATCH 1/6] refscale: add missing '\n' to flush message out

add '\n' to macros directly like what torture does to flush message
for each calls

Signed-off-by: Li Zhijian <[email protected]>
---
kernel/rcu/refscale.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/kernel/rcu/refscale.c b/kernel/rcu/refscale.c
index f055d168365a..ffe9e44c886c 100644
--- a/kernel/rcu/refscale.c
+++ b/kernel/rcu/refscale.c
@@ -44,7 +44,10 @@
pr_alert("%s" SCALE_FLAG s, scale_type, ## x)

#define VERBOSE_SCALEOUT(s, x...) \
- do { if (verbose) pr_alert("%s" SCALE_FLAG s, scale_type, ## x); } while (0)
+ do { \
+ if (verbose) \
+ pr_alert("%s" SCALE_FLAG s "\n", scale_type, ## x); \
+ } while (0)

static atomic_t verbose_batch_ctr;

@@ -54,12 +57,12 @@ do { \
(verbose_batched <= 0 || \
!(atomic_inc_return(&verbose_batch_ctr) % verbose_batched))) { \
schedule_timeout_uninterruptible(1); \
- pr_alert("%s" SCALE_FLAG s, scale_type, ## x); \
+ pr_alert("%s" SCALE_FLAG s "\n", scale_type, ## x); \
} \
} while (0)

#define SCALEOUT_ERRSTRING(s, x...) \
- do { pr_alert("%s" SCALE_FLAG "!!! " s, scale_type, ## x); } while (0)
+ do { pr_alert("%s" SCALE_FLAG "!!! " s "\n", scale_type, ## x); } while (0)

MODULE_LICENSE("GPL");
MODULE_AUTHOR("Joel Fernandes (Google) <[email protected]>");
@@ -842,7 +845,7 @@ ref_scale_init(void)
goto unwind;
}

- VERBOSE_SCALEOUT("Starting %d reader threads\n", nreaders);
+ VERBOSE_SCALEOUT("Starting %d reader threads", nreaders);

for (i = 0; i < nreaders; i++) {
firsterr = torture_create_kthread(ref_scale_reader, (void *)i,
--
2.32.0