[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1352848389-23114-5-git-send-email-schnhrr@cs.tu-berlin.de>
Date: Wed, 14 Nov 2012 00:13:01 +0100
From: Jan H. Schönherr <schnhrr@...tu-berlin.de>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-kernel@...r.kernel.org, Kay Sievers <kay@...y.org>,
Jan H. Schönherr <schnhrr@...tu-berlin.de>
Subject: [PATCH 04/12] printk: reuse reclaimed continuation buffer immediately
cont_add() might flush the continuation buffer before appending
anything. If that happens, the function returns immediately, forcing the
calling function to store the message elsewhere. This is not always
necessary.
When the continuation buffer was reclaimed (and not just marked as
"flushed"), then we can reuse it immediately instead of returning false.
Signed-off-by: Jan H. Schönherr <schnhrr@...tu-berlin.de>
---
kernel/printk.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/printk.c b/kernel/printk.c
index ba9494b..42e5eaf 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -1431,7 +1431,8 @@ static bool cont_add(int facility, int level, enum log_flags flags,
if (cont.len + len > sizeof(cont.buf)) {
/* the line gets too long, split it up in separate records */
cont_flush(0);
- return false;
+ if (cont.len)
+ return false;
}
if (!cont.len) {
--
1.8.0.316.g291341c.dirty
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists