Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1315537 > unrolled thread
| Started by | Sergey Senozhatsky <sergey.senozhatsky@gmail.com> |
|---|---|
| First post | 2016-01-23 09:20 +0100 |
| Last post | 2016-01-23 09:20 +0100 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[RFC][PATCH v3 2/4] printk: do not console_cont_flush() on every jump to again Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2016-01-23 09:20 +0100
| From | Sergey Senozhatsky <sergey.senozhatsky@gmail.com> |
|---|---|
| Date | 2016-01-23 09:20 +0100 |
| Subject | [RFC][PATCH v3 2/4] printk: do not console_cont_flush() on every jump to again |
| Message-ID | <qU1Al-8nr-1@gated-at.bofh.it> |
Every jump to `again' label will call console_cont_flush(),
which is not really something big -- it just adds one extra
raw_spin_lock_irqsave/raw_spin_unlock_irqrestore. However, to
keep the previous behaviour we can call console_cont_flush()
only when `retry' is false -- which happens once, all jumps
to `again' label have `retry' set to true.
Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
---
kernel/printk/printk.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c
index c39232a..dc722fc 100644
--- a/kernel/printk/printk.c
+++ b/kernel/printk/printk.c
@@ -2213,7 +2213,7 @@ void console_unlock(void)
static u64 seen_seq;
unsigned long flags;
bool wake_klogd = false;
- bool do_cond_resched, retry;
+ bool do_cond_resched, retry = false;
if (console_suspended) {
up_console_sem();
@@ -2246,7 +2246,8 @@ again:
}
/* flush buffered message fragment immediately to console */
- console_cont_flush(text, sizeof(text));
+ if (!retry)
+ console_cont_flush(text, sizeof(text));
for (;;) {
struct printk_log *msg;
--
2.7.0
Back to top | Article view | linux.kernel
csiph-web