public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* devfs vs udev, thoughts from a devfs user
@ 2004-02-10 11:34 Mike Bell
  2004-02-10 13:20 ` Helge Hafting
                   ` (3 more replies)
  0 siblings, 4 replies; 59+ messages in thread
From: Mike Bell @ 2004-02-10 11:34 UTC (permalink / raw)
  To: linux-kernel

I've been reading a lot lately about udev and how it's both very
different to and much better than devfs, and with _most_ of the reasons
given, I can't see how either is the case. I'd like to lay out why I
think that is.

I keep hearing about how udev has no naming policy in the kenel, while
devfs has a fixed one and if you don't like it tough. But udev relies on
sysfs, which IS naming policy in the kernel. And devfs has devfsd, which
is a userspace daemon that listens to a kernel-exported filesystem (just
like udev) and can create whatever /dev layout you want from that, in
userspace (just like udev). Basically, udev relies on sysfs exporting
device numbers. Well, imagine for a moment sysfs exported actual device
files instead of just the numbers you'd need to make a device file (a
pretty minor change, though not one I'm advocating). What you've got
there is basically devfs and devfsd, right? Not the same
implementation-wise, obviously, but essentially IDENTICAL concepts.
Kernel exports device files to a kernel-generated filesystem, user-space
daemon creates /dev from those with a layout according to your liking.

Meanwhile, devfs (or a devfs-like solution) offer several things which
udev just can't. Having a special kernel-exported filesystem just for
/dev means your user-space daemon can see when a program is trying to
access a device file that doesn't exist yet, you can't do that with
udev and tmpfs. Moreover, it means you've got a functional /dev that
accurately represents the system regardless of whether the user-space
daemon is running yet. With udev, you're stuck with a static /dev unless
udev is running. This can happen when broken system or doing a fresh
installation, or if you accidentally break your udev binary. And heavens
help you if linux ever moves to dynamic device files, that would make a
static /dev completely unusable. Which would in turn mean that your
system is unusable unless udev is running. It's not a big problem, but
myself I find myself using devfs without devfsd for those two reasons
every once in a while, and in those instances devfs is really nice.

So the question is, is a devfs-like implementation really unfixable? And
if not, is it worth whatever disadvantages can't be avoided? On the
matter of memory usage, I'm really not sure why a new devfs couldn't be
tied to the new device model. As I said earlier, it's only a subtle
change from exporting a major and minor in sysfs to exporting a device
file (in newdevfs or wherever). And I haven't heard anyone say devfs's
race conditions are inherent to the idea, just that devfs's
implementation has them.

Finally, from /my/ experience, the one thing people disliked most about
devfs was the long names for hard drive partitions. But isn't one of the
first things on the agenda for 2.7 taking the partition detection code
out of the kernel and replacing it with device-mapper? If you do that,
then the block devices you actually USE are all device mapper created.
They're already controlled by a user-space daemon. The real block
devices are only used when you're partitioning (or LVMing, or EVMSing,
or whatever). The rest of the time, in /etc/fstab or passing to mkfs or
whatever else, you're using the dm devices. Now there's no reason
a new devfs would HAVE to export long and unwieldy names for block
devices, but if the only time you're actually using those names is for
repartitioning, I really wouldn't care if they were long and unwieldy.
It wouldn't show up in fstab, or df, or anywhere else the devfs style
names have made a nuicance of themselves, so who cares?

Sorry if any of these points has already been discussed on
linux-kernel, I don't have time to read the list so I'm going based on
what's been reported in things like kernel-traffic.

^ permalink raw reply	[flat|nested] 59+ messages in thread
* Re: devfs vs udev, thoughts from a devfs user
@ 2004-02-10 16:10 "Andrey Borzenkov" 
  0 siblings, 0 replies; 59+ messages in thread
From: "Andrey Borzenkov"  @ 2004-02-10 16:10 UTC (permalink / raw)
  To: "Mike Bell" ; +Cc: linux-kernel




> I completely agree. But who would volunteer to spend their time fixing
> devfs if no one said they wanted devfs, if all evidence says everyone is
> happy with udev? I just wanted to get out that I'm not, I think devfs
> (as a concept, not neccessarily the implementation in the kernel right
> now) has merits udev does not and never will possess, and to see if anyone
> else agrees.

I am not happy with udev as it is currently; I am not happy with devfs crashing; I will continue to do what I can as time permits.

I do not neccessarily need devfs - but udev lacks two features I need and I do not see any way to add them without creatign the same sort of problems as devfs has.

>> Devfs can do this, but it is not necessarily a good thing.
>> I tried it - and it only works if someone tries to look up
>> a particluar name, such as /dev/dsp.  It doesn't work when someone
>> does a "ls /dev" to see what devices is there.
>> A "ls /dev/dsp*" didn't find the multiple soundcards for which
>> modules weren't yet loaded.
>

no way. this requires far deeper devfs integration that is currently available. there was code that did it for removable media; it was removed during 2.5 series. fixing bugs in devfs is one thing; reintegrating it into kernel is another.

basically devfs in 2.6 is reduced to

mknod from within drivers
devfsd notification on lookup

> Nor would you want it to... Although, it might be handy for something
> like a SCSI controller. An opendir() in its directory would trigger the
> kernel to see what's attached to it. Postponing the probing of every LUN
> until someone goes looking could speed up boot times quite a bit.

I must admit I never used devfs names myself so it proved rather useless to me even in 2.4 times.

-andrey


^ permalink raw reply	[flat|nested] 59+ messages in thread
[parent not found: <fa.i9mtr77.1pja9qf@ifi.uio.no>]

end of thread, other threads:[~2004-02-27  0:06 UTC | newest]

Thread overview: 59+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox