lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <m1skjdt3a7.fsf@fess.ebiederm.org>
Date:	Sun, 10 May 2009 07:56:32 -0700
From:	ebiederm@...ssion.com (Eric W. Biederman)
To:	Arjan van de Ven <arjan@...radead.org>
Cc:	Greg KH <gregkh@...e.de>, Fabio Comolli <fabio.comolli@...il.com>,
	Kay Sievers <kay.sievers@...y.org>, Greg KH <greg@...ah.com>,
	linux-kernel@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [patch 00/13] devtmpfs patches

ebiederm@...ssion.com (Eric W. Biederman) writes:

> Arjan van de Ven <arjan@...radead.org> writes:
>
>> On Sat, 9 May 2009 09:19:23 -0700
>> Greg KH <gregkh@...e.de> wrote:
>>
>>
>> btw... I would be a LOT happier about the solution from a technical
>> point of view if it wasn't the kernel making the device node, but the
>> kernel exposing a file with a list of all devices, so that userland can
>> chose to mknod or not, with which permissions if non-default and with
>> non-default owners.
>> So basically (and I'm making up a filename here, don't read too much
>> into that)
>>
>> cat /proc/alldevices
>>
>> c   1     4         foobar
>> b   8     0         sda
>> c   122   12        dri/card0
>>
>> etc
>> making the actual nodes from this in the most simple case is basically
>> no time in userspace, but a slightly more advanced early userspace app
>> can even do permissions for the few device nodes where it matters etc.
>>
>> I can imagine that being a good solution that ends up solving your
>> problem, but in a way that is more consistent with what the kernel does
>> right now and how we can then have userland make decisions on where to
>> make the nodes, with what perms etc etc.
>> In fact such a file would be a greeat help in general, and would be a
>> nice generic solution.
>
> I just did a tiny 100 line test app.
>
> It took me all of 0.06s to mount /sys and /dev and to walk sysfs and
> create all 649 of the device nodes. 

Ok.  I just asked the question how much is mknod and how much is
traversing /sys.

If the I hard code the devices to make in my test app the time is,
0.01s, even on my old 700Mhz amd k7.  So the time to traverse sys to
find the device numbers is a big part of the cost.

At the same time.  Things can potentially be sped up quite a bit by
walking /sys/dev/block and /sys/dev/char and just calling readlink.

A cheaper way of reading the devices out of sysfs might be in order,
to ensure the bottleneck is mknod speed.  But I just don't see this
gating boot speed.

Eric
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ