[systemd-devel] [PATCH] journal: Leave server_dispatch_message early when Storage is none

2013-07-18 Thread Holger Hans Peter Freyther
From: Holger Hans Peter Freyther hol...@moiji-mobile.com

When using Storage=none there is no point in collecting all the
information just to throw them away. After this change journald
consumes a lot less CPU time when only forwarding messages.
---
 src/journal/journald-server.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index 369ebf4..f3599b7 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -862,6 +862,11 @@ void server_dispatch_message(
 if (LOG_PRI(priority)  s-max_level_store)
 return;
 
+/* Stop early in case the information will not be stored
+ * in a journal. */
+if (s-storage == STORAGE_NONE)
+return;
+
 if (!ucred)
 goto finish;
 
-- 
1.8.3.2

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] [PATCH] journal: Leave server_dispatch_message early when Storage is none

2013-07-18 Thread Lennart Poettering
On Thu, 18.07.13 14:45, Holger Hans Peter Freyther (hol...@freyther.de) wrote:

 From: Holger Hans Peter Freyther hol...@moiji-mobile.com
 
 When using Storage=none there is no point in collecting all the
 information just to throw them away. After this change journald
 consumes a lot less CPU time when only forwarding messages.

Thanks! Applied!

Lennart

-- 
Lennart Poettering - Red Hat, Inc.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel