From: Timothy Miller <miller@techsource.com>
To: Mike Bell <kernel@mikebell.org>
Cc: Chris Friesen <cfriesen@nortelnetworks.com>,
Greg KH <greg@kroah.com>,
linux-kernel@vger.kernel.org
Subject: Re: devfs vs udev, thoughts from a devfs user
Date: Tue, 10 Feb 2004 15:15:39 -0500 [thread overview]
Message-ID: <40293BEB.9010606@techsource.com> (raw)
In-Reply-To: <20040210192456.GB4814@tinyvaio.nome.ca>
Please forgive me for stepping into this conversation so late...
Mike Bell wrote:
> On Tue, Feb 10, 2004 at 12:52:51PM -0500, Chris Friesen wrote:
>
>>What names would you use for your device files? This is the key
>>difference. With udev it gets a notification that says "I have a new
>>block device", it then looks it up, applies the rules, and creates a new
>>entry. The whole point is to move the naming scheme into userspace for
>>easier management.
>
>
> Why does it make management easier to have no predictable name for a
> device?
>
What's unpredictable about it? udev can apply exactly the same rules
that devfs uses, thereby coming up with the same names. In that limited
case, the advantage to udev is to move code out of the kernel. Not only
does that shrink the kernel, but it moves policy that affects user space
into user space.
If udev had a "devfs" mode where it used a ramdisk for device nodes, and
it produced exactly the same names as devfs, would you be happy with it?
Any device node you needed would have been generated well before you
needed it, and being a filesystem node, it's no slower to actually USE
the device than devfs, and you'd get all the same behavior you had
before. The ONLY difference is that the code isn't in the kernel.
You have the further advantage, for the embedded people, that you can
eliminate udev, and create static device nodes, without having to modify
the kernel in any way.
For the typical case, udev COULD produce the same device names as devfs,
completely addressing your "predictability" issue. It would be
PERFECTLY predictable. But it has the additional advantage of being
able to keep a database in a file that it uses to also make device names
CONSISTENT. Thus, if you attach a USB device and then remove it and
then attach it again later, udev has a simple way to compare that device
against its history of known devices and give that device again exactly
the same name. Can devfs do that? If so, where does it keep its history?
>
>>You could have the kernel export a simple devfs with a hardcoded naming
>>scheme based on similar ideas as what is in sysfs (which would then make
>>sysfs and the daemon optional for tiny embedded setups), but the only
>>advantage over just exporting the information in sysfs is to save a few
>>bytes at the cost of yet another filesystem to maintain.
>
>
> I think the space savings are a pretty good reason alone. Add to that
> the fact I think devfs would be a good idea even if it cost MORE
> memory... You can mount a devfs on your RO root instead of needing to
> mount a tmpfs on /dev and then run udev on that. A devfs gives
> consistant names for devices in addition to the user's preferred
> user-space dictated naming scheme. A devfs means even with dynamic
> majors/minors, even if you have new hardware in your system, your /dev
> at least has the devices it needs.
How does devfs save space? Device node information has to be stores
SOMEWHERE. Whether that's in filesystem nodes or in datastructures in
the kernel that are dynamically made to LOOK like device nodes, you
still need to take up memory.
As for dynamic major/minor numbers, I'm not sure how udev precludes
that. The fact that udev might keep minor numbers from changing over a
reboot doesn't matter. Dynamic major/minor numbers just means that they
can be arbitrary.
next prev parent reply other threads:[~2004-02-10 20:11 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-10 11:34 devfs vs udev, thoughts from a devfs user Mike Bell
2004-02-10 13:20 ` Helge Hafting
2004-02-10 14:46 ` Mike Bell
2004-02-10 17:02 ` Mark Mielke
[not found] ` <20040210160011.GJ4421@tinyvaio.nome.ca>
2004-02-11 9:44 ` Helge Hafting
2004-02-11 20:05 ` Theodore Ts'o
2004-02-10 13:32 ` Ian Kent
2004-02-10 14:00 ` Mike Bell
2004-02-10 17:01 ` Greg KH
2004-02-10 17:13 ` Mike Bell
2004-02-10 17:25 ` Greg KH
2004-02-10 17:46 ` Mike Bell
2004-02-10 18:12 ` Greg KH
2004-02-10 18:29 ` Mike Bell
2004-02-10 22:19 ` Matthew Reppert
2004-02-11 1:10 ` Mike Bell
2004-02-11 10:05 ` Helge Hafting
2004-02-13 21:19 ` Greg KH
2004-02-14 8:51 ` Mike Bell
2004-02-14 9:13 ` Christian Borntraeger
2004-02-14 11:42 ` Helge Hafting
2004-02-14 16:54 ` Greg KH
2004-02-14 17:44 ` Alex Goddard
2004-02-15 8:16 ` Andrew Walrond
2004-02-19 9:47 ` Mike Bell
2004-02-19 19:43 ` Greg KH
2004-02-27 0:02 ` Mike Bell
2004-02-10 19:10 ` Shawn
2004-02-10 17:52 ` Chris Friesen
2004-02-10 19:24 ` Mike Bell
2004-02-10 19:46 ` Chris Friesen
2004-02-10 19:58 ` Tomasz Torcz
2004-02-10 20:11 ` Kevin P. Fleming
2004-02-10 20:39 ` Bill Rugolsky Jr.
2004-02-11 1:16 ` Greg KH
2004-02-11 1:41 ` Kevin P. Fleming
2004-02-11 9:36 ` Maneesh Soni
2004-02-11 7:50 ` viro
2004-02-11 12:33 ` Bill Rugolsky Jr.
2004-02-11 15:11 ` [PATCH] Fix /etc/mtab updating with mount --move [was Re: devfs vs udev, thoughts from a devfs user] Bill Rugolsky Jr.
2004-02-11 19:19 ` devfs vs udev, thoughts from a devfs user dleonard
2004-02-10 20:32 ` Diego Calleja García
2004-02-11 1:20 ` Mike Bell
2004-02-10 20:15 ` Timothy Miller [this message]
2004-02-10 22:24 ` Matthew Reppert
2004-02-11 1:35 ` Mike Bell
2004-02-10 20:44 ` Valdis.Kletnieks
2004-02-10 17:55 ` Mike Bell
2004-02-10 18:19 ` Greg KH
2004-02-10 18:43 ` Mike Bell
2004-02-10 20:11 ` Theodore Ts'o
2004-02-11 1:49 ` Mike Bell
2004-02-10 19:12 ` Mike Bell
2004-02-13 21:08 ` Greg KH
2004-02-10 18:35 ` Greg KH
2004-02-11 1:25 ` Ian Kent
-- strict thread matches above, loose matches on Subject: below --
2004-02-10 16:10 "Andrey Borzenkov"
[not found] <fa.i9mtr77.1pja9qf@ifi.uio.no>
[not found] ` <fa.de6p9mb.1ikipbl@ifi.uio.no>
2004-02-13 22:08 ` walt
2004-02-13 22:18 ` 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=40293BEB.9010606@techsource.com \
--to=miller@techsource.com \
--cc=cfriesen@nortelnetworks.com \
--cc=greg@kroah.com \
--cc=kernel@mikebell.org \
--cc=linux-kernel@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