linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: linux-hotplug@vger.kernel.org
Subject: Re: replace dev.d/ with a rule based program execution
Date: Tue, 22 Feb 2005 08:08:40 +0000	[thread overview]
Message-ID: <421AE888.5060702@suse.de> (raw)
In-Reply-To: <20050221181242.GA22891@vrfy.org>

Kay Sievers wrote:
> Here is an experimental patch to replace the brute-force dev.d/ script
> execution by a rule based model, with the same logic we currently use to
> name a device. While searching for a rule to apply, we collect programs
> to execute after node creation/removal.
> 
> This makes it possible to gain complete control of the execution of programs
> for a specific device instead of letting the programs exit if they don't
> want to handle the device.
> 
> We apply the rule on device remove events too. A ACTION="<value>" match can
> be used to write rules that are only applied on a specific action.
> 
> I've replaced the following:
>   [kay@pim ~]$ tree /etc/dev.d/
>   /etc/dev.d/
>   |-- default
>   |   |-- 00-log.dev
>   |   |-- 05-pam_console.dev -> ../../udev/scripts/pam_console.dev
>   |   `-- 10-hal.dev -> /usr/libexec/hal.dev
>   |-- fd0
>   |   `-- 10-MAKEDEV.dev -> ../../udev/scripts/MAKEDEV.dev
>   |-- fd1
>   |   `-- 10-MAKEDEV.dev -> ../../udev/scripts/MAKEDEV.dev
>   |-- fd2
>   |   `-- 10-MAKEDEV.dev -> ../../udev/scripts/MAKEDEV.dev
>   |-- fd3
>   |   `-- 10-MAKEDEV.dev -> ../../udev/scripts/MAKEDEV.dev
>   `-- sound
>       `-- alsa.dev
> 
> With these rules:
>   KERNEL="ttyUSB*", HOTPLUG="<usb-serial-device program>"
>   SUBSYSTEM="tty", OPTIONS="no_hotplug"
>   SUBSYSTEM="vc", OPTIONS="no_hotplug"
> 
>   ACTION="add", SUBSYSTEM="sound", HOTPLUG="/etc/dev.d/sound/alsa.dev"
>   ACTION="add", KERNEL="fd*", HOTPLUG="/etc/udev/scripts/MAKEDEV.dev"
>   ACTION="add", HOTPLUG="/etc/udev/scripts/pam_console.dev"
> 
>   HOTPLUG="/usr/libexec/hal.dev"
>   HOTPLUG="/etc/dev.d/default/00-log.dev"
> 
> On my box, udevstart takes 2.1 seconds instead of 8.6 seconds to run with
> my default setup. Mainly because it will not run anything for all the virtual
> tty devices. Any tty device which should be catched, needs a rule before the
> "no_hotplug" option.
> 
> It is also possible to pass arguments to the scripts, which sometimes
> makes it no longer necessary to wrap a program with a shell script.
> 
> We could also remove all the hardcoded knowledge about sysfs in the
> wait_for_sysfs logic and replace it by a few simple ignore_device rules.
> 
> The same model could easily replace the whole hotplug.d/ multiplexing and
> give use an efficient rule based event management with a single source of
> policy.
> 
> What do you think?
> 
YES. This is a Good Thing (tm).
Go for it.

Otherwise udevstart performance is basically killed by tty events.

And vc events, but this is another story.

Too sad we've already entered feature freeze ...

Cheers,

Hannes
-- 
Dr. Hannes Reinecke			hare@suse.de
SuSE Linux AG				S390 & zSeries
Maxfeldstraße 5				+49 911 74053 688
90409 Nürnberg				http://www.suse.de


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id\x14396&opÌk
_______________________________________________
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:[~2005-02-22  8:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-21 18:12 replace dev.d/ with a rule based program execution Kay Sievers
2005-02-22  8:08 ` Hannes Reinecke [this message]
2005-02-22 17:53 ` Harald Hoyer
2005-02-23  1:08 ` Marco d'Itri
2005-02-24 20:15 ` David Zeuthen
2005-02-24 20:34 ` Kay Sievers
2005-02-24 20:45 ` David Zeuthen
2005-02-24 21:04 ` Kay Sievers
2005-02-24 21:52 ` Kay Sievers
2005-02-24 22:03 ` David Zeuthen
2005-02-25 23:26 ` Greg KH
2005-02-26  0:28 ` Kay Sievers
2005-02-26  0:57 ` Marco d'Itri
2005-02-26  1:04 ` Kay Sievers
2005-02-26  1:06 ` Marco d'Itri
2005-02-26  2:22 ` Kay Sievers

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=421AE888.5060702@suse.de \
    --to=hare@suse.de \
    --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).