From: Arjan van de Ven <arjan@infradead.org>
To: Kay Sievers <kay.sievers@vrfy.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
linux-kernel@vger.kernel.org,
Greg Kroah-Hartmann <greg@kroah.com>
Subject: Re: [PATCH] Remove broken by design and by implementation devtmpfs maintenance disaster
Date: Fri, 18 Sep 2009 17:13:28 +0200 [thread overview]
Message-ID: <20090918171328.7a102223@infradead.org> (raw)
In-Reply-To: <ac3eb2510909180758u2131ae0eo9030a97cdde75bc6@mail.gmail.com>
On Fri, 18 Sep 2009 16:58:28 +0200
Kay Sievers <kay.sievers@vrfy.org> wrote:
> > Lets be clear:
> > 1) modprobe already does some serialization (right now on the kernel
> > side, but ideally we move that to modprobe binary so that we can
> > skip that when we can)
>
> We only serialize symbol linking I guess, and that window got pretty
> small in recent kernels.
more than that; there's also an async_synchronize_full() function call.
I'd love to be able to move that down into modprobe.
>
> > 2) udev today has a small design issue that is relatively easy to
> > fix. Right now, the rules call modprobe manually, each and every
> > one of them. What is needed is a MODPROBE += directive for these
> > instead of the RUN += that is done today. This is not (just) for
> > this issue here, but is essential to reduce the cost of udev. A big
> > chunk of udev cost is in doing dozens and dozens of useless
> > modprobe execs; the only way to solve this is by having a MODPROBE
> > +=. (useless because the thing they modprobe doesn't exist)
>
> That would help in which case? Which single event does do more than a
> single modprobe call? What do you want to collect?
DRIVER!="?*", ENV{MODALIAS}=="?*", RUN{ignore_error}+="/sbin/modprobe
$env{MODALIAS}"
I don't want to "collect". What I want is to have udev check the module
alias database directly for existence, rather than exec()ing modprobe
100 times, which then reads in that same table, etc 100 times.
if you measure things, these 100 aliases (of which maybe 5 cause a real
module to load) causing 100 execs is a rather significant chunk of
where the udev cost during boot goes.... from where I sit that makes it
worth optimizing ;)
>
> > 3) if we move synchronization for other things to modprobe, it might
> > make sense to move the device node synchronization to it as well.
> > Exactly for the scenario you described, to get a good, generic
> > solution, that also makes sure that the permissions/ownership/etc of
> > the device node is also the right one.
>
> How do you know what to sync against, what to wait for? I'm pretty
> sure the sync creation is much simpler and solves most of the problems
> in the right way.
it's only sync creation if the device init/registration is also sync.
for performance I suspect we need to end with an *option* to just load
all modules based on the device in the system, without waiting, and
then at the end of loading all, say, 60 modules, wait before udev
continues.
that is different than later on loading, say, the loop module by hand,
where the user expects "full synchronization". The device node is a
small part of that, and clearly a relevant part, but it all goes
together. The moment modprobe synchronizes explicitly (albeit by
default) for the device init, it can and likely could also sync the
full device creation (so including owner/acl/selinux context etc),
providing a solution to the problem you want, but including the
owner/acl bits.
I suspect you're now going "lalalala" ;-)
but I'm not saying all of this to diss your devfs code. I'm saying that
*regardless of* your code, modprobe likely needs to start doing
these synchronization steps over time.
--
Arjan van de Ven Intel Open Source Technology Centre
For development, discussion and tips for power savings,
visit http://www.lesswatts.org
next prev parent reply other threads:[~2009-09-18 15:13 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-17 8:23 [PATCH] Remove broken by design and by implementation devtmpfs maintenance disaster Eric W. Biederman
2009-09-17 12:03 ` Kay Sievers
2009-09-17 13:13 ` Alan Cox
2009-09-17 16:35 ` Scott James Remnant
2009-09-17 17:47 ` Arjan van de Ven
2009-09-17 18:59 ` Scott James Remnant
2009-09-17 19:11 ` Arjan van de Ven
2009-09-18 12:57 ` Eric W. Biederman
2009-09-18 13:16 ` Eric W. Biederman
2009-09-18 13:54 ` Eric W. Biederman
2009-09-18 14:09 ` Arjan van de Ven
2009-09-18 14:11 ` Kay Sievers
2009-09-18 14:25 ` Arjan van de Ven
2009-09-18 14:32 ` Kay Sievers
2009-09-18 14:43 ` Arjan van de Ven
2009-09-18 14:58 ` Kay Sievers
2009-09-18 15:13 ` Arjan van de Ven [this message]
2009-09-18 15:32 ` Kay Sievers
2009-09-18 19:33 ` Eric W. Biederman
2009-09-18 14:42 ` Eric W. Biederman
2009-09-17 12:57 ` Greg KH
2009-09-17 13:05 ` Alan Cox
2009-09-17 13:29 ` Greg KH
2009-09-17 15:43 ` Alan Cox
2009-09-18 6:03 ` Greg KH
2009-09-18 9:25 ` Alan Cox
2009-09-18 15:05 ` Greg KH
2009-09-17 17:29 ` Eric W. Biederman
2009-09-17 18:53 ` [bug] /etc/profile: line 30: /dev/null: Permission denied (Was: Re: [PATCH] Remove broken by design and by implementation devtmpfs maintenance disaster) Ingo Molnar
2009-09-17 19:18 ` Kay Sievers
2009-09-17 20:26 ` Linus Torvalds
2009-09-17 20:31 ` Ingo Molnar
2009-09-18 5:58 ` Greg KH
2009-09-25 20:49 ` Pavel Machek
2009-09-27 22:52 ` Greg KH
2009-09-17 22:26 ` Kay Sievers
2009-09-17 22:41 ` Alan Cox
2009-09-18 0:18 ` Linus Torvalds
2009-09-18 1:50 ` Kay Sievers
2009-09-18 6:02 ` Greg KH
2009-09-18 11:50 ` Kay Sievers
2009-09-18 14:18 ` Linus Torvalds
2009-09-18 15:05 ` Greg KH
2009-09-18 15:37 ` Kay Sievers
2009-09-18 19:35 ` Kay Sievers
2009-09-18 19:41 ` Linus Torvalds
2009-09-18 19:50 ` Ingo Molnar
2009-09-20 1:43 ` Dave Airlie
2009-09-20 15:08 ` Greg KH
2009-09-21 2:58 ` Dave Airlie
[not found] ` <ac3eb2510909200912o76e0d4e4l2dcaf352fe6b4e19@mail.gmail.com>
[not found] ` <ac3eb2510909200914g1ed6a47cydc0edec6fff96ef4@mail.gmail.com>
2009-09-21 2:59 ` Dave Airlie
2009-10-20 20:32 ` Scott James Remnant
2009-09-20 17:33 ` Ingo Molnar
2009-09-18 20:58 ` [bug] /etc/profile: line 30: /dev/null: Permission denied Eric W. Biederman
2009-09-18 21:09 ` Linus Torvalds
2009-09-18 21:19 ` Kay Sievers
2009-09-18 22:06 ` Linus Torvalds
2009-09-18 21:31 ` Kay Sievers
2009-09-18 22:03 ` Eric W. Biederman
2009-09-18 5:54 ` [PATCH] Remove broken by design and by implementation devtmpfs maintenance disaster Greg KH
2009-09-18 12:24 ` Eric W. Biederman
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=20090918171328.7a102223@infradead.org \
--to=arjan@infradead.org \
--cc=ebiederm@xmission.com \
--cc=greg@kroah.com \
--cc=kay.sievers@vrfy.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.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