From mboxrd@z Thu Jan 1 00:00:00 1970 From: Martin Pitt Date: Mon, 21 Dec 2009 15:18:46 +0000 Subject: speed up udev-acl.mk [was: Re: CK.OpenSession(): Do not block on Message-Id: <20091221151846.GB2268@piware.de> MIME-Version: 1 Content-Type: multipart/mixed; boundary="gj572EiMnwbLXET9" List-Id: To: linux-hotplug@vger.kernel.org --gj572EiMnwbLXET9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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.=20 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 --=20 Martin Pitt | http://www.piware.de Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org) --gj572EiMnwbLXET9 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAksvkdYACgkQDecnbV4Fd/If2ACbB9fKenmb0mJwt43lVQmFYXKH ssIAniKv1xP+HFFtkgzOWV/JhpsiBfXd =ptNB -----END PGP SIGNATURE----- --gj572EiMnwbLXET9--