Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1315537
| From | Sergey Senozhatsky <sergey.senozhatsky@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [RFC][PATCH v3 2/4] printk: do not console_cont_flush() on every jump to again |
| Date | 2016-01-23 09:20 +0100 |
| Message-ID | <qU1Al-8nr-1@gated-at.bofh.it> (permalink) |
| References | <qU1Al-8nr-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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 linux.kernel | Previous | Next | Find similar | Unroll thread
[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
csiph-web