linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kay Sievers <kay.sievers@vrfy.org>
To: linux-hotplug@vger.kernel.org
Subject: Re: [PATCH] convert udevsend/udevd to using datagram sockets
Date: Wed, 04 Feb 2004 14:02:52 +0000	[thread overview]
Message-ID: <20040204140252.GA32490@vrfy.org> (raw)
In-Reply-To: <40209893.8080109@sympatico.ca>

On Wed, Feb 04, 2004 at 02:00:35AM -0500, Chris Friesen wrote:
> This patch does a couple of things to udevsend/udevd.  It doesn't touch
> udev itself at all.
> 
> 1) It switches to using the abstract namespace.  This simplifies things
> since you don't have to go around unlinking.  When the socket goes away,
> the address is gone.

This is really nice, I like it. Didn't know that this is possible.

Do you have any idea what we can do with the lock file. It would be very
nice to get rid of it, cause we remount the filesystem and it's gone.

> 2) The protocol between udevsend and udevd is fundamentally
> message-based.  This patch recognizes this by using SOCK_DGRAM rather
> than SOCK_STREAM, which simplifies the message protocol.  (Note that
> with unix sockets, you can still detect if the daemon is not running
> with SOCK_DGRAM. )
> 
> 3) The main loop in udevd is much simplified.  Part of this is due to
> the lower complexity of datagram sockets.  As well, the new main loop
> just calls a plain function that sits on a blocking recv() to handle
> incoming messages instead of spawning a thread that does almost nothing
> and then exits.

You are talking about complexity, but what is about speed?

blocking daemon:
  time for i in `seq 1 100`; do SEQNUM=$i ACTION­d DEVPATH=$i ./udevsend x; done
  real    0m1.175s
  user    0m0.054s
  sys     0m0.081s

threading daemon:
  time for i in `seq 1 100`; do SEQNUM=$i ACTION­d DEVPATH=$i ./udevsend x; done
  real    0m0.048s
  user    0m0.018s
  sys     0m0.029s

I don't see what we get with the blocking I/O. It seems more like
personal taste than numbers. :)
You may catch up with NPTL and old thread issues.
Linux is _now_ really really nice with threads.


> There is still a hole if the message gets delivered and the server
> crashes before it gets handled--to close that we would need an ack
> message.  If anyone wants us to be that paranoid, it would be easy to
> implement.

Uhh, first switch to unreliable communication and the make a protocol by
yourself? Sounds a bit crazy.

> Any comments?

I can see your motivation, but unless we can get rid of _all_ the threads
or at least getting faster, I don't want to change it.

thanks,
Kay


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

  reply	other threads:[~2004-02-04 14:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-04  7:00 [PATCH] convert udevsend/udevd to using datagram sockets Chris Friesen
2004-02-04 14:02 ` Kay Sievers [this message]
2004-02-04 15:34 ` chris_friesen
2004-02-04 21:06 ` Mike Waychison
2004-02-05  1:24 ` Chris Friesen
2004-02-05  2:08 ` Mike Waychison
2004-02-05  6:53 ` Chris Friesen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040204140252.GA32490@vrfy.org \
    --to=kay.sievers@vrfy.org \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).