From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Kay Sievers <kay.sievers@vrfy.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
Arjan van de Ven <arjan@infradead.org>,
Peter Zijlstra <peterz@infradead.org>, Greg KH <gregkh@suse.de>,
Andrew Morton <akpm@linux-foundation.org>,
Fabio Comolli <fabio.comolli@gmail.com>, Greg KH <greg@kroah.com>,
linux-kernel@vger.kernel.org
Subject: Re: [patch 00/13] devtmpfs patches
Date: Mon, 11 May 2009 16:53:17 +0100 [thread overview]
Message-ID: <20090511165317.3da5326f@lxorguk.ukuu.org.uk> (raw)
In-Reply-To: <ac3eb2510905110714m5877da13q19b42d1c8565777c@mail.gmail.com>
> But he does not use an initramfs, and distros insist to do that. And
> that basically means you need to prepare /dev two times, and also prep
Once. You may want to move a few bits later. You only need null,
zero and console to get started. Thats three fixed device nodes.
If we have stable block numbers you might need more than one extra if you
have to search for a UUID/label and it moved from where you cached
it. Without stable block numbers you can't cache the node but most create
lots of nodes to go looking. Do I understand that bit right ?
However you still only create it once as you have zero, console and null
on the initrd already and do
mkdir final-dev
mount tmpfs
create them in final-dev
mount root
move final-dev
Tell me if I'm going astray here as I want to clearly understand the
problem.
Another data point: On a fairly typical PC on a single CPU we can do over
30,000 mknods per second on tmpfs. I've just benched it. So you can
create those block nodes very fast indeed.
On a 1 second budget I can create 3000 device nodes (which should cover
most user systems quite adequately) and have 0.9 seconds left to do other
work.
> > Device spaces have user controlled naming rules, user controlled
> > permissions, user controlled labelling and the like. That is policy, and
> > the administering of that is management.
>
> I see. But that does not change at all. It's just that you can also
> bring up the box without the complex management we need to do today.
If you have an environment using any of those features then not having
that management is not a win - its a bug.
> > That was one of the things that killed devfs eventually, and it's not a
> > problem your proposal or devfs solved.
>
> Oh, that old devfs was killed for many good reasons, sure. The biggest
> reason alone to kill it, was the dumb new naming scheme, which broke
The "naming scheme" ? It was not the naming scheme but the inability to
make it do stuff the way users wanted. If the naming scheme had been
trivially configurable then the distro would simply have shipped a
different naming scheme.
> As mentioned, we create 12.000 files in sysfs, now we just add 210 and
setfacl -m u:alan:r /sys/devices/virtual/dmi/id/bios_vendor
setfacl: /sys/devices/virtual/dmi/id/bios_vendor: Operation not supported
Sysfs doesn't even support per user ACLs which means its not much use for
tty devices or a lot of other things where you want to give access to a
piece of hardware to groups of users or use SELinux to control root more
tightly.
> decouple the kernel initial bootup from a complex userspace
> dependency, all for the sake of robustness, that is also faster and
> very flexible.
It isn't flexible. You can't set the naming policy, you can't set the
permissions, you can't control the labelling. It might be a convenient
way to implement a very specific narrow set up.
> No, that problem is solved by exporting all of it in sysfs already
> today. But that does not provide any of the robustness and reliability
> gains the kernel-provided nodes do.
What is robust and reliable about having another set of nodes that an
existing distro won't know about and existing tools don't know about that
has permissions and labels that bypass the security as configured by the
system administrator ????
> > 5. Make the new big block numbers stable
>
> Might be nice to have, but we still can't include all of the possible
> block driver names and nodes in initramfs. Distros can just not manage
> that, and don't do it today.
Even if we have to create a lot of nodes it shouldn't be slow - mknod
syscalls on tmpfs are as we've just established - quite acceptably quick.
Yes I think stable numbers would be smart.
> Mine does too. But general purpose systems have different problems to solve.
I'm of the opinion your system isn't general purpose - its Kay purpose.
If it can become truely general purpose and replace or improve udev with
something far better then great but can it ?
> > - Why you think sysfs changes will help when the stats say its 0.06 of a
> > second and udev is not it appears taking much time anyway
>
> Which sysfs changes?
(Sorry that was Eric I think)
>
> > - How you think you've solved the devfs problems about persistency and
> > the like and what performance cost that has. That killed devfs in the
> > end.
>
> What problem?
The problem I've been pointing out all along - security, naming,
permissions, persistency.
> Let me know what specifically needs to be fixed, I'll do it right
> away, I wrote and maintain most of it, so I should be pretty quick to
> act here. I work on it almost every day, and I mostly don't find it
> non-funny. :)
So if you maintain it why is it so slow ? (that isn't an accusation of
incompetence btw I want to understand the bottlenecks) - what percentage
is CPU wait, what is I/O wait, wtf are we doing with all that wall time
and serialized probing ? You've still not provided any useful data on
timings. If you had four or five pet programmers and were told "fix udev"
what would you direct them to sort out ? The numbers you've posted
contain no breakdown. Yes its faster than the old system for your
specific case but there is no "why" in the data.
There isn't any reason it should magically go faster in kernel. We don't
run the CPU at a different speed in kernel and syscalls are cheap.
> > but it does actually get us something featureful
> > and useful that does what people want.
>
> Actually, many people asked for more robustness and less complexity to
> bring up a box, not for more special hacks in udev, initramfs, the
> boot scripts. That's what we try to solve here, and what we did, from
> my perspective.
"from my perspective" - bingo...
Which is the devfs problem - its easy to solve a problem for one
perspective or one user only. But we'd have an awful lot of devfs clones
in the kernel if we kept doing that.
So I'd like
- my device file system to do SELinux and ACLs (and Tomoyo and ...)
- ability to set labels and security contexts and permissions
- device nodes in one place only
- ability to use security models which take stuff away from root (so
chmodding the sysfs node 000 doesn't cut the mustard)
- a guarantee I can't race the policy application and node creation on
hotplug. In other words the creator sets up its security contexts and
the like then does the node create.
Putting device nodes into sysfs can't do most if any of that
Putting the data to create those initial device nodes into sysfs *can*
make it customisable this way. It also means your initrd can be more
robust because the device creation logic is very very simple.
sh < /sys/initial-device-list
might be slightly extreme but you need little more when not using fancy
feature sets. We've just established by benchmarking that the mknod paths
are fast enough.
It's a question of API and layering
If you put the devices into sysfs I get burger and fries the way you like
If you put the list of devices into sysfs I get to decide how I want it.
We have enough fixed nodes to run a recovery shell in the initrd or boot
with init=/bin/sh so the recovery argument doesn't seem to hold water.
The performance for reading one sysfs file (even without sysfs
optimisation) and writing 3000 device nodes to disk is more than
acceptable so if you don't mind I'd prefer my burger with extra onions ;)
next prev parent reply other threads:[~2009-05-11 15:54 UTC|newest]
Thread overview: 95+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20090509142601.874865281@blue.kroah.org>
2009-05-09 14:37 ` Greg KH
2009-05-09 14:26 ` [patch 01/13] Driver Core: add nodename callbacks Greg KH
2009-05-10 12:52 ` Stephen Rothwell
2009-05-10 13:19 ` Kay Sievers
2009-05-11 20:51 ` Greg KH
2009-05-09 14:26 ` [patch 02/13] Driver Core: misc: add nodename support for misc devices Greg KH
2009-05-15 19:58 ` Pavel Machek
2009-05-18 14:34 ` Greg KH
2009-05-18 19:59 ` Pavel Machek
2009-05-18 20:28 ` Alan Cox
2009-05-09 14:26 ` [patch 03/13] Driver Core: usb: add nodename support for usb drivers Greg KH
2009-05-09 14:26 ` [patch 04/13] Driver Core: block: add nodename support for block drivers Greg KH
2009-05-09 14:26 ` [patch 05/13] Driver Core: x86: add nodename for cpuid and msr drivers Greg KH
2009-05-09 14:26 ` [patch 06/13] Driver Core: dvb: add nodename for dvb drivers Greg KH
2009-05-09 14:26 ` [patch 07/13] Driver Core: input: add nodename for input drivers Greg KH
2009-05-09 14:26 ` [patch 08/13] Driver Core: sound: add nodename for sound drivers Greg KH
2009-05-09 14:26 ` [patch 09/13] Driver Core: raw: add nodename for raw devices Greg KH
2009-05-09 14:26 ` [patch 10/13] Driver Core: drm: add nodename for drm devices Greg KH
2009-05-09 14:26 ` [patch 11/13] Driver Core: aoe: add nodename for aoe devices Greg KH
2009-05-09 14:26 ` [patch 12/13] Driver Core: bsg: add nodename for bsg driver Greg KH
2009-05-09 14:26 ` [patch 13/13] Driver Core: devtmpfs - driver core maintained /dev tmpfs Greg KH
2009-05-09 15:10 ` [patch 00/13] devtmpfs patches Fabio Comolli
2009-05-09 15:08 ` Greg KH
2009-05-09 15:22 ` Arjan van de Ven
2009-05-09 16:19 ` Greg KH
2009-05-09 19:09 ` Arjan van de Ven
2009-05-10 4:34 ` Arjan van de Ven
2009-05-10 7:48 ` Eric W. Biederman
2009-05-10 14:56 ` Eric W. Biederman
2009-05-10 5:34 ` Andrew Morton
2009-05-10 15:20 ` Greg KH
2009-05-10 15:59 ` Arjan van de Ven
2009-05-10 18:31 ` Peter Zijlstra
2009-05-10 21:19 ` Alan Cox
2009-05-10 23:47 ` Kay Sievers
2009-05-11 0:00 ` Arjan van de Ven
[not found] ` <ac3eb2510905101822t7fde14b3nf2c689621f69c925@mail.gmail.com>
2009-05-11 2:36 ` Eric W. Biederman
2009-05-11 10:46 ` Kay Sievers
2009-05-11 10:55 ` Alan Cox
2009-05-11 11:34 ` Kay Sievers
2009-05-11 13:05 ` [patch 00/13] devtmpfs Arjan van de Ven
2009-05-11 13:28 ` Kay Sievers
2009-05-11 13:49 ` Arjan van de Ven
2009-05-11 14:59 ` Kay Sievers
2009-05-11 13:10 ` [patch 00/13] devtmpfs patches Alan Cox
2009-05-11 14:14 ` Kay Sievers
2009-05-11 14:30 ` Arjan van de Ven
2009-05-11 14:42 ` Kay Sievers
2009-05-11 15:53 ` Alan Cox [this message]
2009-05-11 16:28 ` Kay Sievers
2009-05-11 16:41 ` Arjan van de Ven
2009-05-11 17:32 ` Kay Sievers
2009-05-11 17:55 ` Alan Cox
2009-05-11 18:04 ` Kay Sievers
2009-05-11 18:40 ` Alan Cox
2009-05-11 16:56 ` Alan Cox
2009-05-11 18:13 ` Eric W. Biederman
2009-05-11 3:55 ` Arjan van de Ven
2009-05-11 11:49 ` Fabio Comolli
2009-05-11 17:47 ` Greg KH
2009-05-11 16:40 ` Eric W. Biederman
2009-05-11 17:16 ` Kay Sievers
2009-05-11 21:13 ` Eric W. Biederman
2009-05-11 1:00 ` Andrew Morton
2009-05-11 3:58 ` Arjan van de Ven
2009-05-11 17:45 ` Greg KH
2009-05-09 16:46 ` Kay Sievers
2009-05-09 17:11 ` Alan Cox
2009-05-09 18:09 ` Kay Sievers
2009-05-11 17:40 ` David P. Quigley
2009-05-11 17:56 ` Greg KH
2009-05-11 20:41 ` David P. Quigley
2009-05-11 21:05 ` Kay Sievers
2009-05-11 21:19 ` Alan Cox
2009-05-11 21:27 ` Kay Sievers
2009-05-12 12:45 ` Stephen Smalley
2009-05-12 15:10 ` Kay Sievers
2009-05-12 15:35 ` Stephen Smalley
2009-05-12 15:54 ` Kay Sievers
2009-05-12 22:55 ` Kay Sievers
2009-05-12 23:22 ` David P. Quigley
2009-05-12 23:34 ` Kay Sievers
2009-05-12 23:50 ` Greg KH
2009-05-13 12:22 ` Stephen Smalley
2009-05-13 12:58 ` Kay Sievers
2009-05-13 12:57 ` Stephen Smalley
2009-05-13 13:09 ` Kay Sievers
2009-05-13 12:59 ` Alan Cox
2009-05-13 13:20 ` David Howells
2009-05-13 13:34 ` Kay Sievers
2009-05-13 14:20 ` Kay Sievers
2009-05-13 14:35 ` Stephen Smalley
2009-05-13 16:45 ` Kay Sievers
2009-05-13 22:43 ` Eric W. Biederman
2009-05-13 23:10 ` Greg KH
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=20090511165317.3da5326f@lxorguk.ukuu.org.uk \
--to=alan@lxorguk.ukuu.org.uk \
--cc=akpm@linux-foundation.org \
--cc=arjan@infradead.org \
--cc=ebiederm@xmission.com \
--cc=fabio.comolli@gmail.com \
--cc=greg@kroah.com \
--cc=gregkh@suse.de \
--cc=kay.sievers@vrfy.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.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
all inboxes | Powered by JetHome®