linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Steven Dake <sdake@mvista.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] udev enhancements to use kernel event queue
Date: Fri, 13 Jun 2003 09:42:16 -0700	[thread overview]
Message-ID: <20030613164216.GB5799@kroah.com> (raw)
In-Reply-To: <3EE9F2E5.1050407@mvista.com>

On Fri, Jun 13, 2003 at 08:51:01AM -0700, Steven Dake wrote:
> >I now respond:
> >Bootup time reduction would be a great thing to have.  And I agree for
> >situations where 1 second is a considerable amount of time, it is
> >important.  However, 99.99% of the people running Linux out there, do
> >not have those problems.  And even then, for those 00.01% of the people
> >who do, they do whatever they possibly can to keep from having to reboot
> >at all.  I still say the measurable ammount of time to plug in a new
> >disk and have it's device node created is not measurable, from using
> >/sbin/hotplug and udev, and using your character node.  Also, the
> >ultimate solution for these kinds of people is the in-kernel devfs, or
> >the current static /dev.  If they use either of them, it's guaranteed to
> >be faster then yours or mine implementation.
> > 
> >
> I suppose it is possible that devfs could be faster, however, there are 
> significant amounts of policies that can never be done in devfs which 
> must be done in user space.  For these types of applications, it makes 
> sense to provide the fastest mechanism available, even when it may only 
> improve boot performance by 1 second.

That's what devfsd can be used for.  It provides you with a way to get
those events, in a binary fashion, with no out-of-order issues, in a
"quick" way.  People have implemented persistant device naming schemes
by using this interface in the past.  Don't write something new when
what you are looking for is already there.

> I understand what you mean by saying that 99.99% of users don't care 
> about availability.  While those particular users may spend significant 
> amounts of time improving Linux, it is the remaining folks that care 
> about availability that are interested in investing money into r&d to 
> improve availability while also improving feature set.  It is this set 
> of folks, (the people that do care about availability) that this patch 
> is targeted towards.

Like Pat said, until you prove the speed and uptime differences between
the following, I don't see how you can say this with a straight face:
	- The default /sbin/hotplug for Redhat 9 systems
	- The default /sbin/hotplug for Montavista systems.
	- my mini-hotplug
	- Your sdeq
	- devfsd
After running those numbers, please let us know what you find out.
	
> >I now respond:
> >Doing a mknod() on a node that is already present doesn't harm anything.
> >And since you have to keep a database around of what devices are
> >present, and what you have called them, removing them after already
> >removing them again, is detectable.  So handing the same event twice
> >isn't a problem.
> > 
> >
> I suppose you could handle multiple events twice, but the ability to 
> detect a replacement without the OS removing the initial kobject is now 
> removed.  This is a real case which should be handled.

Um, huh?  How can the OS not remove a kobject, and not tell userspace?
And if a device is unplugged, and then plugged right back in again, in
the same place, with the same attributes (which is the only way you
would not be able to detect this easily), what is the big problem?  You
would act apon that device in the same way, again, which would be just
fine.

> >As for the memory issues, if no one ever reads from the character node,
> >it will constantly fill up with events, right?  Shouldn't they be
> >eventually flushed out at some point in time?
> >
> This is a problem...  I wasn't quite sure how to handle this.  The two 
> choices are to include timeouts in events (after a certain amount of 
> time, events are timed out and freed) or to allow only a certain number 
> of events, after which events at the front of the queue are flushed.
> 
> The reality though, is that the user will be running the daemon to clear 
> out the events.  If they don't, then they get what they deserve :)

Heh, then your kernel which _has_ to stay up (due to your previous
guarantees of uptime) keels over.  I don't think that by requiring that
a kernel _has_ to have a specific userspace program running in order for
it to stay healthy would be anying any "carrier grade" user would ever
agree to.

:)

> >Also for trying to remove events, why is userspace allowed to remove a
> >multiple of events at once?  I would think that a valid read would
> >remove that event, you can have two applications grab the same event,
> >which is not what I think you want to have happen.
> >
> I probably should have explained why this decision was made.  I believe 
> it is desireable to be able to handle multiple events at once.  The 
> process is: user reads all events on event queue, user processes events, 
> user deletes all events atomically.  This solves the problem of what 
> happens if the daemon crashes during deletion of events, or during 
> processing of events.  The daemon will be able to totally recover and 
> process events properly.

But your implementation does not do this, so you added features and
complexity before they were needed :)

Again, you are relying on a userspace program to keep the kernel safe,
not a wise choice.

> >So, because of this, I still think that everything you are trying to do
> >can be successfully done from userspace today (or use devfsd today, it
> >will give you the same info!)  And due to that, I do not think this code
> >is necessary to be in the kernel.
> > 
> >
> Everything could possibly be done in userspace, but performance is poor, 
> and I am still concerned about the out-of-order events issue.

We just solved the out-of-order events issue.  I don't see any proof of
your performance claims.  Hence, I don't think this patch should be
applied.

thanks,

greg k-h

  parent reply	other threads:[~2003-06-13 16:29 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-12 19:10 [PATCH] udev enhancements to use kernel event queue Steven Dake
2003-06-12 21:47 ` Patrick Mochel
2003-06-13 16:31   ` Steven Dake
2003-06-13 17:06     ` Patrick Mochel
2003-06-12 21:47 ` Greg KH
2003-06-12 22:03   ` Andrew Morton
2003-06-12 22:50     ` Greg KH
2003-06-12 22:51       ` Andrew Morton
2003-06-12 23:02         ` Greg KH
2003-06-12 23:09           ` Greg KH
2003-06-12 23:14             ` Patrick Mochel
2003-06-12 23:16             ` Robert Love
2003-06-12 23:25               ` Greg KH
2003-06-13 20:01                 ` Oliver Neukum
2003-06-18 22:59                   ` Greg KH
2003-06-19  0:12                     ` Kevin P. Fleming
2003-06-19  0:20                       ` Greg KH
2003-06-19  0:42                         ` Kevin P. Fleming
2003-06-19  0:51                           ` Greg KH
2003-06-19  0:25                       ` Andrew Morton
2003-06-19  6:27                       ` Oliver Neukum
2003-06-12 23:25               ` Patrick Mochel
2003-06-12 23:29                 ` Robert Love
2003-06-12 23:32                   ` Greg KH
2003-06-12 23:34                   ` Patrick Mochel
2003-06-12 23:40                     ` Paul Mackerras
2003-06-12 23:50                       ` Robert Love
2003-06-13 12:44                         ` Richard B. Johnson
2003-06-13 12:54                           ` Olivier Galibert
2003-06-12 23:52                       ` Patrick Mochel
2003-06-13  8:41                       ` Alan Cox
2003-06-13 11:00                         ` Paul Mackerras
2003-06-13 11:07                           ` Herbert Xu
2003-06-13 13:31                           ` Alan Cox
2003-06-13 19:57                             ` Joe Korty
2003-06-13 21:10                               ` Alan Cox
2003-06-13 11:17                       ` David Schwartz
2003-06-13 15:44                         ` Davide Libenzi
2003-06-12 23:42                     ` Robert Love
2003-06-12 23:45                     ` Davide Libenzi
2003-06-12 23:05       ` Robert Love
2003-06-19 19:51       ` Werner Almesberger
2003-06-26 12:17         ` Tommi Virtanen
2003-06-26 14:35           ` Werner Almesberger
2003-06-13  8:40     ` Alan Cox
2003-06-13  9:14       ` Olivier Galibert
2003-06-19 20:53         ` Werner Almesberger
2003-06-13 16:05       ` Steven Dake
2003-06-13 16:32       ` Greg KH
2003-06-13 15:51   ` Steven Dake
2003-06-13 16:41     ` Patrick Mochel
2003-06-13 16:42     ` Greg KH [this message]
2003-06-13 17:17       ` Chris Friesen
2003-06-12 22:27 ` Oliver Neukum
2003-06-13 16:03   ` Steven Dake
2003-06-13 16:50     ` Patrick Mochel
2003-06-13 17:10       ` Steven Dake
2003-06-13 18:26         ` Greg KH
2003-06-13 19:02         ` Patrick Mansfield
2003-06-13 17:32     ` Oliver Neukum
2003-06-13 18:23     ` Greg KH
2003-06-13 18:24     ` Greg KH
2003-06-13  7:17 ` Christoph Hellwig
2003-06-13 18:06 ` Linus Torvalds
2003-06-19 23:32   ` Werner Almesberger
2003-06-19 23:42     ` Steven Dake
2003-06-20  0:05       ` Linus Torvalds
2003-06-20  0:10         ` Steven Dake
2003-06-20  0:43           ` Linus Torvalds
2003-06-20  2:26             ` Werner Almesberger
2003-06-20 17:03             ` Steven Dake
2003-06-20 17:18               ` Patrick Mochel
2003-06-14  6:36 John Bradford

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=20030613164216.GB5799@kroah.com \
    --to=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sdake@mvista.com \
    /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).