DBus in the kernel?

Luiz Augusto von Dentz luiz.dentz at gmail.com
Tue Jan 5 00:23:09 PST 2010


Hi.

On Mon, Jan 4, 2010 at 11:55 PM, Lennart Poettering <mzqohf at 0pointer.de> wrote:
> On Mon, 04.01.10 16:40, Havoc Pennington (havoc.pennington at gmail.com) wrote:
>
>>
>> What is the rationale for the bus itself in the kernel? Seems like one
>> big pain in the ass, and I can't guess the motivation...
>
> Primarily three things:
>
> 1) Getting rid of the double context switch for each msg. Right now
> for the usual synchronous remote system call you need at least 4
> context switches. If we can get rid of the message dispatching in
> userspace we can reduce that to 2. On x86 the context switches
> might be cheap, but on other CPUs (ARM) they are not.
>
> 2) This could allow eventual implementation of zero-copy data
> transfer, which is already available for the traditional socket
> types. That could make dbus viable as a trasnport for substantial
> data, e.g. PCM data or video frames.
>
> 3) This can fix priority-inversion problems, since two high-priority
> processes would not have to wait for a non-high-prio dbus daemon to
> dispatch things. (unless you make the whole daemon high-prio which is
> dangerous too however). This is actually a real problem.
>
> And then, besides that it makes a lot of things more light-weight,
> since memory consumption and copying is reduced, hence less cache
> pressure, fewer processes, fds, other resources...

If I remember correctly there is also some other benefits to the boot
if the the system bus happen to be initialized by kernel as there are
quite many dbus daemons nowadays. Anyway the 3 reasons you gave should
be enough to convince most, including myself.

-- 
Luiz Augusto von Dentz
Engenheiro de Computação


More information about the dbus mailing list