[systemd-devel] [RFC] [PATCH 0/3] journal: Add deferred log processing to reduce synchonous IO overhead

Lennart Poettering lennart at poettering.net
Thu Dec 12 10:05:23 PST 2013


On Thu, 12.12.13 17:42, Karol Lewandowski (lmctlx at gmail.com) wrote:

> > Hmm, but this wouldn't be any different from old syslog, right? I mean,
> > old syslog also uses sendv() and recv() on AF_UNIX SOCK_DGRAM sockets...
> 
> That's true, however, we aren't migrating from syslog, but from
> Android Logger.  Android provides /dev/log_{main,radio,...} device
> nodes which are simple in-kernel circular buffers apps can write to at
> any time.  This was invented when /dev/kmsg wasn't writable and serves
> more-or-less same purpose.
> 
> From 2.6.29 it's in mailine kernel under
> drivers/staging/android/logger.c

But if the the socket layer is really thaaaaat much slower than android
logging, then that's kinda sad, and the kernel socket stuff should
probably be fixed?

> > > This is why I decided to try to make logging completely async and see
> > > if/what changes.
> > 
> > Well, if AF_UNIX is slow, then we really should try to fix that in the
> > kernel instead of bypassing it in userspace... Whether we rely on the
> > socket buffer of the AF_UNIX socket or put together our own buffer in
> > /dev/shm shouldn't be much of a difference if they both have the same
> > size and can take the same number of entries...
> 
> I do agree.  Truth is I have looked at linux/net/ code once but I
> didn't grok it well.  I guess it's the time to take a second look. ;)

Here's another option: extend journald to use kdbus as additional
transport. This is something we want to do anyway since the kdbus
transport will attach the metadata we need without race to each
packet. Given that kdbus ultimately is just a way to write into an
mmaped tmpfs that some other process owns this should not be much worse
than the android logger in performance.

Special care needs to be taken to make this work though, as we should do
this only on kdbus systems. On non-kdbus systems journald can never talk
to dbus, because dbus-daemon is a client of journald and things would
deadlock...

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list