Alban Crequy, a Maemo developer, for the past several weeks have been working on bringing D-Bus directly into the Linux kernel. Why? Huge performance improvements.
Alban's kernel D-Bus work is based upon the previous work of Ian Molton did for Collabora with KDbus
for prototyping a kernel implementation so that D-Bus cuts down the number of required context switches that are needed compared to running the D-Bus daemon in user-space.
Here is Alban's description on how his implementation of D-Bus for the Linux kernel works:
When an application sends a message on the bus to another application, the message is first sent to dbus-daemon through an Unix socket. The kernel copies the message to the receiving queue of dbus-daemon and dbus-daemon wakes up. Then dbus-daemon adds the sender field in the header of the message, and sends it to the recipients according to the destination field and the match rules (usually one recipient but there could be more for signals or in case of eavesdropping)...So dbus-daemon wakes up on every message, it costs a context switch and a memory copy.
Benchmarks published by Alban with his kdbus work shows this implementation running nearly twice as fast when using KVM on i386 and up to three times faster with ARM on the Nokia N900 hand-held. In other benchmarks the gains were less but still quite significant in terms of performance increases.
The blog post with benchmarks and patches to go against the Linux 2.6.35 kernel and the D-Bus library (libdbus) can be found on this page
. At this point the work is still considered a proof-of-concept and not ready for merging into the mainline Linux kernel, but hopefully it's not too far out from being ready.