[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1354813571-11253-6-git-send-email-schnhrr@cs.tu-berlin.de>
Date: Thu, 6 Dec 2012 18:06:02 +0100
From: Jan H. Schönherr <schnhrr@...tu-berlin.de>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Kay Sievers <kay@...y.org>
Cc: linux-kernel@...r.kernel.org, Joe Perches <joe@...ches.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Stephen Rothwell <sfr@...b.auug.org.au>,
Jan H. Schönherr <schnhrr@...tu-berlin.de>
Subject: [PATCH v2 05/14] 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 f6a91ec..7328348 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -1430,7 +1430,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();
- return false;
+ if (cont.len)
+ return false;
}
if (!cont.len) {
--
1.8.0.1.20.g7c65b2e.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