Skip to contentSkip to conversation

DEVFS is very good compared to UDEV

DISCUSSION Jari Soderholm 11 participants 15 messages Dec 23, 2003 – Dec 27, 2003

lore
Share & tools
lore
#0 lore raw

Hello !

I am quite advanced Linux user who has used DEVFS quite long time, and have also been a little suprised that it has been marked OBSOLETE in 2.6 kernel.

I think that there are plenty good arguments why in many cases it is technically better solution than udev, and I like to give my view on that.

DEVFS is a really simple to use, compile it into kernel and configure the programs to use DEVFS filenames and thats it.

I think that it is very good that devicename files are out from the disk, one cannot delete those files, disk errors do not affect the, and searching device files is faster.

Booting kernel is faster compared to UDEV.

And DEVFS has worked for years for me at least very well, I haven't had any problems with it.

I do not understand some opinions that DEVFS uses memory.
Compared to the size of applications people run in linux
, the memory what kernel with DEVFS takes is practically
nonexistent.
I think that files in SYSFS-directory (needed by UDEV) probably take more memory than those in DEVFS-dir.

UDEV otherwise is very complex for average user and it is definetly much slower , it has much greater chance for errors because very complicated scrips which seem to need many different gnu commandline utilities.

It is quite funny that when DEVFS creates device files automagically and in the ram-memory, some people want
to go backwards, and use shell scripts to
create those files on hard disk, and then it is technically better solution.

If one you look at the /sysfs-directory there are device filenames, (but not the actual devicefiles), so it does same thing that DEVFS, but actually much worce way, it created devicefilenames in the ram, but one cannot use them, because they are not devicefiles.

Why could you develop it so that UDEV could create those actual device files there also, then most linux users would not need those horrible scipts anymore. All that is then needed link from /sysfs to /dev dir.

In my option good operating system kernel should use disk and external programs little as possible.

T Jari Söderholm
jari.soderholm#stadia.fi

#1 lore raw
Quoted 6 lines · Jari Soderholm

Hello !

I am quite advanced Linux user who has used DEVFS quite long time, and have also been a little suprised that it has been marked OBSOLETE in 2.6 kernel.

If you were such an advanced Linux user you'd read this list or at least search it to understand the problems. DevFS may have seemed fine to you, but the code is nasty and full of races. It's overly complicated and the problems it exhibits were determined to not be easily fixable and not worth the time. DevFS never really took off and it was under development for a good part of 4 years. Richard Gooch did an admirable job trying to come up with a new solution to the old /dev situation, but frankly a new approach was needed, and he himself recognized this and abandoned devfs.

Quoted 4 lines

I think that there are plenty good arguments why in many cases it is technically better solution than udev, and I like to give my view on that.

How do you know this? Have you looked at the code to both? You can't be telling me you've looked at the devfs code and think its superior in any way to other pitiful hacks in the kernel. Come on now. And UDEV and libsysfs are works in progress, and I must say they've come a long way in a very short time. Kudos to Greg and others BTW.

Quoted 2 lines

DEVFS is a really simple to use, compile it into kernel and configure the programs to use DEVFS filenames and thats it.

Userspace can adapt to a different solution.

Quoted 3 lines

I think that it is very good that devicename files are out from the disk, one cannot delete those files, disk errors do not affect the, and searching device files is faster.

UDEV is currently slow right now while some libsysfs changes are being made IIRC. Not a very apt comparison.

Quoted 2 lines

Booting kernel is faster compared to UDEV.

See above.

Quoted 2 lines

And DEVFS has worked for years for me at least very well, I haven't had any problems with it.

Consider yourself lucky.

Quoted 6 lines

I do not understand some opinions that DEVFS uses memory.
Compared to the size of applications people run in linux
, the memory what kernel with DEVFS takes is practically
nonexistent.
I think that files in SYSFS-directory (needed by UDEV) probably take more memory than those in DEVFS-dir.

How on earth do you figure this? The /sys directory is links to things that are already in memory, it is just providing a way to access those structures and information, think procfs.

Quoted 5 lines

UDEV otherwise is very complex for average user and it is definetly much slower , it has much greater chance for errors because very complicated scrips which seem to need many different gnu commandline utilities.

It's still young and will be better as time passes. At least UDEV isn't going to take 4 years and come out with crap.

Quoted 5 lines

It is quite funny that when DEVFS creates device files automagically and in the ram-memory, some people want
to go backwards, and use shell scripts to
create those files on hard disk, and then it is technically better solution.

Honestly I'm trying to sound insulting here, but consider the fact that only a couple of people are currently working on UDEV, and yeah some things are hacked together right now. And remember init is mostly shell scripts, I don't see how this is so inferior.

Quoted 6 lines

If one you look at the /sysfs-directory there are device filenames, (but not the actual devicefiles), so it does same thing that DEVFS, but actually much worce way, it created devicefilenames in the ram, but one cannot use them, because they are not devicefiles.

*sigh* see above

Quoted 5 lines

Why could you develop it so that UDEV could create those actual device files there also, then most linux users would not need those horrible scipts anymore. All that is then needed link from /sysfs to /dev dir.

*sigh* read the FAQ

Quoted 2 lines

In my option good operating system kernel should use disk and external programs little as possible.

Here we go, IMO, I like that :) The thing is, you need some cooperation and balance between the kernel and userspace. Things are shelled off to userspace because they can be, and it also takes burden off the core kernel functions and reduces the kernel's memory footprint. This is good for embedded devices too.

Ok for the sake of non-argument, keep using devfs if you want, but remember it is obsolete, and nothing is going to change that AFICS.

Good Luck,

sb

Quoted 9 lines

T Jari Söderholm
jari.soderholm#stadia.fi

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

#2 lore raw
In reply to Jari Soderholm

On Tue, 2003-12-23 at 16:20, Jari Soderholm wrote:

(please use a mailer that wraps lines, in the future)

Quoted 3 lines

I am quite advanced Linux user who has used DEVFS quite long time, and have also been a little suprised that it has been marked OBSOLETE in 2.6 kernel.

devfs is marked obsolete for more reasons that just the presence of udev. Devfs is also buggy, poorly designed, and unmaintained.

Quoted 2 lines

DEVFS is a really simple to use, compile it into kernel and configure the programs to use DEVFS filenames and thats it.

udev, in time, we be even easier than this: just install it. It will use the historic kernel naming (FHS names) so you need not change your programs, although a devfs-style naming policy is possible

Quoted 3 lines

I think that it is very good that devicename files are out from the disk, one cannot delete those files, disk errors do not affect the, and searching device files is faster.

udev can store files on a tmpfs (or any other) mount, if so desired.

Quoted 1 line

Booting kernel is faster compared to UDEV.

Today, udev is not even involved in booting, so this cannot possible be true. If you mean running the udev initscript is slow, perhaps it is:
but eventually that will not be needed.

Also, udev is nascent and still under development. It has not been fine-tuned yet.

Quoted 2 lines

And DEVFS has worked for years for me at least very well, I haven't had any problems with it.

Lucky you. It is a mess.

Quoted 4 lines

I do not understand some opinions that DEVFS uses memory. Compared to the size of applications people run in linux , the memory what kernel with DEVFS takes is practically nonexistent.

I never heard this argument, actually, and I agree it is not an important one.

Quoted 4 lines

UDEV otherwise is very complex for average user and it is definetly much slower , it has much greater chance for errors because very complicated scrips which seem to need many different gnu commandline utilities.

The user will never have to do with the command line stuff. And udev does not involve any complicated scripts.

And, as I said, I do not yet buy the slower argument.

Quoted 4 lines

It is quite funny that when DEVFS creates device files automagically and in the ram-memory, some people want
to go backwards, and use shell scripts to
create those files on hard disk, and then it is technically better solution.

udev is not a shell script and, as I said, udev can use _anything_ as its backing store -- whether that is a directory on your root partition, an NFS mount, or a tmpfs mount.

Quoted 5 lines

If one you look at the /sysfs-directory there are device filenames, (but not the actual devicefiles), so it does same thing that DEVFS, but actually much worce way, it created devicefilenames in the ram, but one cannot use them, because they are not devicefiles.

sysfs is a tree of the kernel's in-memory representation of devices.

We do _not_ want to put the device naming policy in the kernel. User-space should handle that.

Quoted 4 lines

Why could you develop it so that UDEV could create those actual device files there also, then most linux users would not need those horrible scipts anymore. All that is then needed link from /sysfs to /dev dir.

This was proposed before, and certainly do-able. Someone (Linus, I think?) shot it down.

But this is not a huge step from current udev. Is it that big a deal whether the device nodes are created new or symlinked? It is the same solution, either way.

Quoted 2 lines

In my option good operating system kernel should use disk and external programs little as possible.

In my opinion, good operating system kernels should be wise to correctly delineate between what should be in user-space and what should be in the kernel.

Rob Love

#3 lore raw
Quoted 10 lines · Jari Soderholm

(please use a mailer that wraps lines, in the future)

Quoted 3 lines

I am quite advanced Linux user who has used DEVFS quite long time, and have also been a little suprised that it has been marked OBSOLETE in 2.6 kernel.

devfs is marked obsolete for more reasons that just the presence of udev. Devfs is also buggy, poorly designed, and unmaintained.

I do not care about devfs, and I believe/trust udev is a better approach.

But I do have sth fair to say about this "unmaintained" part.

Quoted 1 line

From my memory, at some point in time, somebody (Al Viro?) reviewed

devfs code and flamed the author in public (klml), throwing lots of bad impolite words to him, which I think was the biggest reason that the author stopped maintaining it. This was one of the projects that got killed by flames, or improper handling with flames (another one that comes to mind is CML2).

Correct (but not flame :-) me if I am wrong.

#13 lore raw
In reply to Jari Soderholm
Quoted 4 lines · Jari Soderholm

Why could you develop it so that UDEV could create those actual device files there also, then most linux users would not need those horrible scipts anymore. All that is then needed link from /sysfs to /dev dir.

Well, udev way of doing things is very similar to Solaris. While booting with -r, or by creating /.reconfigure, Solaris kernel scans the hardware and creates entries in /devices tree. The /dev entries are just symlinks to /devices entries.

#4 lore raw
In reply to Hua Zhong
Quoted 10 lines · Hua Zhong

But I do have sth fair to say about this "unmaintained" part.

From my memory, at some point in time, somebody (Al Viro?) reviewed devfs code and flamed the author in public (klml), throwing lots of bad impolite words to him, which I think was the biggest reason that the author stopped maintaining it. This was one of the projects that got killed by flames, or improper handling with flames (another one that comes to mind is CML2).

Correct (but not flame :-) me if I am wrong.

Well, Al definitely shot forth many flames over devfs, for sure :)

I do not know the time line of the flames vs. any decisions made by Richard, though. Some flamage was definitely earlier, when Richard was active, and some flames were definitely after Richard scaled back his kernel development. And, yes, Al flames very hard and a bit rude -- but I have never seen him wrong, that is for sure ;-)

So I cannot comment over _why_ defvs is unmaintained, but that is not the point: either way, it stands that devfs is unmaintained. That is a problem in and of itself.

Rob Love

#5 lore raw
Quoted 2 lines

I do not know the time line of the flames vs. any decisions made by Richard, though.

I believe this is what I saw but I am not exactly sure:

http://www.ussg.iu.edu/hypermail/linux/kernel/0110.3/0712.html

And at that time Richard claimed he was still active.

Quoted 2 lines

And, yes, Al flames very hard and a bit rude -- but I have never seen him wrong, that is for sure ;-)

Me neither :-) and when he is not flaming me (which I have not got the chance yet), it's fun to read. But I hate him, you know, because I now tend to be influenced by the way he (and several others on this list) writes emails, and that's not nice in a corporate environment!!

Quoted 3 lines

So I cannot comment over _why_ defvs is unmaintained, but that is not the point: either way, it stands that devfs is unmaintained. That is a problem in and of itself.

It's just my impression that around that time core developers had decided to replace devfs with a new model. If I were in ths same shoes, I would probably also stop maintaining it. Then 2 years later when somebody asks, the reason to replace my code shouldn't be "unmaintained". Just the technical reasons should be enough. :-)

Quoted 1 line

Rob Love

#10 lore raw
In reply to Hua Zhong
Quoted 6 lines · El Tue, 23 Dec 2003 14:21:03 -0800 "Hua Zhong" <[email protected]> escribió:

From my memory, at some point in time, somebody (Al Viro?) reviewed devfs code and flamed the author in public (klml), throwing lots of bad impolite words to him, which I think was the biggest reason that the author stopped maintaining it. This was one of the projects that got killed by flames, or improper handling with flames (another one that comes to mind is CML2).

I think the problem with CML2 was the author not willing to submit CML2 in small patches adressing single problems instead of One Big Patch.

#6 lore raw
In reply to Hua Zhong
Quoted 4 lines · Hua Zhong

Me neither :-) and when he is not flaming me (which I have not got the chance yet), it's fun to read. But I hate him, you know, because I now tend to be influenced by the way he (and several others on this list) writes emails, and that's not nice in a corporate environment!!

You should not hate anyone. But especially not Al.

Quoted 5 lines

It's just my impression that around that time core developers had decided to replace devfs with a new model. If I were in ths same shoes, I would probably also stop maintaining it. Then 2 years later when somebody asks, the reason to replace my code shouldn't be "unmaintained". Just the technical reasons should be enough. :-)

Sure. But, it is unmaintained today, regardless of why, and that is a factor in deciding how to proceed.

Rob Love

#11 lore raw
In reply to Hua Zhong
Quoted 6 lines · Hua Zhong

But I do have sth fair to say about this "unmaintained" part.

Quoted 1 line

From my memory, at some point in time, somebody (Al Viro?) reviewed

devfs code and flamed the author in public (klml), throwing lots of bad impolite words to him, which I think was the biggest reason that the author stopped maintaining it.

Oh, really? That "flame in public" was after _many_ months of pointing to the same problems in private - with zero effect.

If maintainer sits on exploitable holes for ~18 months and does not care to do anything, his code is unmaintained. If same maintainer keeps pretending in public that everything is fine, he can expect to have the truthfulness of his statements challenged. Also in public. If the situation persists even after that, then yes, there will be rather unflattering things to say.

Don't delude yourself - critical parts of devfs had not been maintained for quite a while before Richard had disappeared. It's not the effect of flames
- it's their cause and it predates them by _far_.

#7 lore raw
In reply to Hua Zhong
Quoted 9 lines · Hua Zhong
Quoted 3 lines

So I cannot comment over _why_ defvs is unmaintained, but that is not the point: either way, it stands that devfs is unmaintained. That is a problem in and of itself.

It's just my impression that around that time core developers had decided to replace devfs with a new model. If I were in ths same shoes, I would probably also stop maintaining it. Then 2 years later when somebody asks, the reason to replace my code shouldn't be "unmaintained". Just the technical reasons should be enough. :-)

Back in June of 2001, Pat Mochel and I talked with Richard about this whole driver model, sysfs, and udev design at the 2001 kernel summit, after presenting it to all of the other kernel developers. He had some objections, but was very aware of what we wanted to do.

It's not like udev and this whole sysfs / driver model implementation snuck into the kernel late at night when no one else was looking, and pounced on all of the poor, unsuspecting devfs users, eating them for a early morning snack.

greg k-h

#8 lore raw
In reply to Hua Zhong
Quoted 4 lines · Hua Zhong

Me neither :-) and when he is not flaming me (which I have not got the chance yet), it's fun to read. But I hate him, you know, because I now tend to be influenced by the way he (and several others on this list) writes emails, and that's not nice in a corporate environment!!

Why, thank you. It's a bit early for New Year present, but it certainly makes a good one ;-)

#9 lore raw
Quoted 2 lines · On Tue, Dec 23, 2003 at 11:26:27PM +0000…

Why, thank you. It's a bit early for New Year present, but it certainly makes a good one ;-)

It's not the 25th yet, so it's not too early for that day. ;)

#12 lore raw
In reply to Hua Zhong

And Al Viro was not the first person to flame Richard Gooch. Well before that flame fest, Richard would joke about he had a talent for attracking flames.

Signature · 3 lines
                          I won't rest till it's the best ...
                          Programmer, Linux Scalability
                          Paul Jackson <[email protected]> 1.650.933.1373
#14 lore raw
In reply to Jari Soderholm
Quoted 2 lines · Jari Soderholm

Booting kernel is faster compared to UDEV.

Mmm. Doesn't seem that way to me. What have I missed?

Quoted 5 lines

UDEV otherwise is very complex for average user and it is definetly much slower , it has much greater chance for errors because very complicated scrips which seem to need many different gnu commandline utilities.

Didn't seem to difficult to me when I checked out both systems this last few days. In fact I like'em both.

Quoted 5 lines

It is quite funny that when DEVFS creates device files automagically and in the ram-memory, some people want
to go backwards, and use shell scripts to
create those files on hard disk, and then it is technically better solution.

Some how I don't think that's the reason for that statement.

Quoted 6 lines

If one you look at the /sysfs-directory there are device filenames, (but not the actual devicefiles), so it does same thing that DEVFS, but actually much worce way, it created devicefilenames in the ram, but one cannot use them, because they are not devicefiles.

Looks to me like that was never the aim of sysfs. I haven't checked into sysfs yet but I suspect it is quite different to devfs.

Quoted 5 lines

Why could you develop it so that UDEV could create those actual device files there also, then most linux users would not need those horrible scipts anymore. All that is then needed link from /sysfs to /dev dir.

That would take away the ability to have a changeable device naming scheme. One of the main reasons for having dynamic device name mapping system is to map the names from a device detection system to specified (possibly changing) naming scheme.

Please don't get me wrong. I like devfs very much and I see it has come a long way since I last used it, but it needs work just to maintain its current functionality within 2.6.

Ian