Announcement

Collapse
No announcement yet.

Bringing D-Bus Into The Linux Kernel

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • rohcQaH
    replied
    fabiank22:

    You seem to believe that X and applications use a different communication mechanism, one that magically avoids system calls, memory copies and context switches. You're wrong.

    When X talks to the app it uses the same mechanism that amarok uses to talk to dbus_daemon, or that MineSweeper.exe uses to talk to wineserver. The overhead you're talking about is equally present in any kind of IPC, be it pipes or real network connections. That overhead has to be there to ensure security and a sane userspace API.

    (right, it's not present in SHM-hacks, but let's ignore those for obvious reasons.)

    Of course we can avoid this overhead by moving one end of the communication channel to kernel space. Moving Firefox would yield a large absolute speedup (a context switch and a few cycles for every message sent), but a marginal relative speedup (because message sending is just a very very small part of firefox).

    Moving D-Bus would yield a small absolute speedup, because typically only few messages are sent. Of course it's a large relative speedup if all you're looking at is a synthetic benchmark of D-Bus.


    I'd say that improving desktop speed by putting DBus somewhere it doesn't belong is about as smart as improving the fuel efficiency of a SUV by installing better blinker lights.

    Leave a comment:


  • monraaf
    replied
    Hmm, isn't D-Bus supposed to be cross-platform? Moving some of it to the Linux kernel doesn't sound very helpful in that regard.

    Leave a comment:


  • fabiank22
    replied
    Originally posted by rohcQaH View Post
    There are more messages between Firefox and X than D-Bus messages on my whole desktop. If it's just about eliminating the system calls and memory copies, moving either Firefox or X into the kernel would save way more CPU cycles than moving D-Bus.
    I don't think you understand what D-Bus is really, so let's start from the ground up.

    Every application talks to the Display Server, calling repaints and everything, but those are not kernel messages/kernel mode switches, that is user mode communication. Inital Modesetting is one of the few things that the X-Server did in Kernel Mode(Thus requiring root rights), but we are moving away from that.

    D-Bus however is Daemon for Applications to talk to each other over this protocol instead of the crazy way of shared memory. So if, let's say Amarok changes the song played it calls out a D-Bus Message, and the Now Listening-Plugin of your instant messenger will pick it up. The daemon for D-Bus resides in User-Space, but messages between processes happen in Kernel-Space, so you have a context switch every time a message is send.

    Firefox communicating with X does not happen in Kernel-Mode. Sure your drivers may actually do some Hardware calls in Kernel-Mode, but once again, pushing Firefox into the kernel will not make it faster(or may make it faster due to other factors, threading and stuff like that, but can you spell security nightmare?)

    So yeah, D-Bus' only purpose makes him actively use Kernel-Space, and it's a cornerstone of the modern fs-ecosystem so why not merge it there?

    Leave a comment:


  • BlackStar
    replied
    Originally posted by rohcQaH View Post
    There are more messages between Firefox and X than D-Bus messages on my whole desktop. If it's just about eliminating the system calls and memory copies, moving either Firefox or X into the kernel would save way more CPU cycles than moving D-Bus.

    Any other arguments why moving D-Bus into kernelspace is supposedly a good idea, while moving firefox isn't?
    Nice strawman.

    Leave a comment:


  • DeepDayze
    replied
    Originally posted by fabiank22 View Post
    Which proves my point?
    Maybe there needs to be a better more efficient way to do dbus message handling.

    Leave a comment:


  • rohcQaH
    replied
    Originally posted by fabiank22 View Post
    The only reason for the massive speedup in D-Bus is because D-Bus is a userspace daemon that has to do A LOT of switching to Kernel Mode whenever it's used. Firefox needs to do nothing in kernel mode.
    There are more messages between Firefox and X than D-Bus messages on my whole desktop. If it's just about eliminating the system calls and memory copies, moving either Firefox or X into the kernel would save way more CPU cycles than moving D-Bus.

    Any other arguments why moving D-Bus into kernelspace is supposedly a good idea, while moving firefox isn't?

    Leave a comment:


  • Snickersnack
    replied
    Originally posted by tball View Post
    Speed is always an issue my friend. I you can do anything to improve it, do it.
    Like program everything in optimized assembler?

    Leave a comment:


  • tball
    replied
    Originally posted by RealNC View Post
    Everyone wants dbus. My desktop won't function without. But I have a PC, not a Nokia phone. Speed is not an issue.
    Speed is always an issue my friend. I you can do anything to improve it, do it.

    Leave a comment:


  • RealNC
    replied
    Originally posted by fabiank22 View Post
    And once again: The kernel is modular - you don't want D-Bus don't build it.
    Everyone wants dbus. My desktop won't function without. But I have a PC, not a Nokia phone. Speed is not an issue.

    Leave a comment:


  • fabiank22
    replied
    Originally posted by DeepDayze View Post
    DCOP is a KDE thing not a general userspace message bus and definitely old and has reached its limits, thus dbus was born. Also Gnome just started using dbus as well so it isn't just a KDE thing now any longer and it has gotten the same benefits as KDE did.
    Which proves my point?

    Leave a comment:

Working...
X