From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kay Sievers Date: Sat, 16 Oct 2004 00:08:57 +0000 Subject: Re: strange delays in vc class Message-Id: <20041016000857.GA1288@vrfy.org> List-Id: References: <20041015000446.GA2796@vrfy.org> In-Reply-To: <20041015000446.GA2796@vrfy.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Fri, Oct 15, 2004 at 04:20:01PM -0700, Greg KH wrote: > On Fri, Oct 15, 2004 at 10:09:25PM +0200, Kay Sievers wrote: > > On Fri, Oct 15, 2004 at 09:18:26PM +0200, Kay Sievers wrote: > > > On Fri, Oct 15, 2004 at 11:59:35AM -0700, Greg KH wrote: > > > > > > > > Ugh. In looking at the kernel code, I don't see how it could be doing > > > > this. But the console startup code is a strange beast... > > > > > > The close will remove the "dev" file and the wait_for_sysfs from the > > > add-hotplug will spin and fail or at best will recover with the next > > > hotplug-add. The "remove" event beats the "add"! We have the same event > > > serializing problem here, we solved with udevd for udev. > > > > I may reactivate my old hotplugd work to address this? > > > > We merge udev and udevd. We parse the config and rules once on startup and > > then wait for events as udevd does today. > > > > On a kernel event udevd does a fork() but _no_ exec(). This will create a > > new instance of the same code with the already parsed config in memory. > > > > The forked udevd instance will: > > o wait for sysfs internally > > o if needed create the node and set the environment > > o execute /etc/hotplug.d/ scripts (with DEVPATH in the environment) > > > > This leads to: > > o complete serialized hotplug sequence handling > > o hotplug.d/ execution with sane sysfs state and created node > > o no more dev.d/ (can just live in hotplug.d/) > > o no udev disk activity (with nodes and db on tmpfs) > > o only one process fork() for every event (besides possible callouts) > > > > It is a bit far from the current model but we already rely on a running > > daemon. I've had something like this in mind with all my recent work. > > In the very long run we may even set /proc/sys/kernel/hotplug to "" after > > bootup and udevd(hotplugd) can get the hotplug-events over netlink :) > > > > What do you think? > > I think it's a big rewrite from what we have working today :) I would call it a reoganization :) We have all stuff already working, just in a different way. > Although some of the benifits you list might be nice to have. I don't > know how well we could get rid of the dev.d/ stuff, as we still can't > map hotplug events to dev.d/ events without running through udev (so a > hotplug.d script would know where to be placed.) We use the SEQNUM in HAL to do this. The idea is, that we have only _one_ kind of event and only one directory to handle that. Ther is no longer the need to map anything. Let me try to be more clear: o We have one daemon listening for kernel events: - no other action is taken on a kernel event than let the daemon know about it - no multiplexer shell script runs o The daemon (like current udevd): - reorders the events - prevents parallel event execution for the same DEVPATH - forks one helper per event o The helper instance (like current udev): - waits for sysfs - creates the device node if neccessary and places DEVNAME into the environment - forks all scripts in hotplug.d/ even when no device node was created All current dev.d/ scripts can moved to hotplug.d/ and will work as before. All scripts in hotplug.d/ will have the device node created, the right sequence order and sysfs fully populated. Kay ------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ 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