From: Martin Pitt <martin.pitt@ubuntu.com>
To: linux-hotplug@vger.kernel.org
Subject: speed up udev-acl.mk [was: Re: CK.OpenSession(): Do not block on
Date: Mon, 21 Dec 2009 15:18:46 +0000 [thread overview]
Message-ID: <20091221151846.GB2268@piware.de> (raw)
[-- Attachment #1: Type: text/plain, Size: 1414 bytes --]
Hello Lennart,
Lennart Poettering [2009-12-21 15:32 +0100]:
> The dbus messages really need to be the last thing that happens, the
> seat.d hooks *must* be finished first, unless you are a sucker for
> raciness nightmares.
Fair enough.
> Also note that /usr/lib/ConsoleKit/run-seat.d/udev-acl.ck is actually
> *not* a script.
Right, I know. I meant "hook".
> I cannot really believe that there is really that much to optimize
> here in this area... Except maybe that udev-acl might not be
> particularly fast since it iterates through the device list
> linearly?
It currently runs for about half a second (on a Dell Mini 10 anyway
[1]), which is really quite a lot. udev-acl uses udev_enumerate()
which always walks the entire /sys tree. In this case this isn't even
conceptually necessary since all we do is a property match (finding
ACL_MANAGE devices), and properties are stored in udev itself (rather,
/dev/.udev/db/) instead of the sysfs tree.
I just committed a slight optimization which cuts down the number of
readlink() and stat() by a third in this case. Completely avoiding the
/sys traversal is more difficult, but I'm still working on that.
Martin
[1] http://people.canonical.com/~scott/daily-bootcharts/20091221-max.png
--
Martin Pitt | http://www.piware.de
Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
next reply other threads:[~2009-12-21 15:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-21 15:18 Martin Pitt [this message]
2009-12-21 15:25 ` speed up udev-acl.mk [was: Re: CK.OpenSession(): Do not block on 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=20091221151846.GB2268@piware.de \
--to=martin.pitt@ubuntu.com \
--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).