[lkml]   [1999]   [Oct]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [linux-usb] Re: USB device allocation
   Date:   Tue, 5 Oct 1999 21:49:41 -0400
From: Johannes Erdfelt <>

I was advocating devfs because it's there. My understanding about devfs
now is that's mostly userspace. The only thing kernel space is a /proc
like dynamic fs interface for devfs. All of the policy is in userspace.

... and it's the policy part which is the hard part.

Look, there's basically three pieces to the problem. One part is somehow
notifying the user-space daemon that some device has appeared, so it can
take appropriate action (either creating the device, or changing the
modes on the device after devfs magically makes it appears).
The second part is the user-space daemon itself, where all of the policy
is contained. And the third part is the the filesystem interface which
makes "/dev" appear, and maintaines persistance of ownership and modes
across reboots, etc.

Devfs uses the dynamic filesystem idea for the first and third parts,
while it's "neat", it's not the right interface for doing things. The
problems are most obvious in the third part: /dev has state that needs
to be persistent. If you store it in a real filesystem, you get that
for free. With devfs, you have this extra kernel code to store all of
the devices in memory, and in a real filesystem you get this for free.
In order to handle persistence, in devfs you have to have this horrible
kludge where you run tar over the devfs at shutdown time. And, any
claims of performance speedup because "devfs is in memory", is
completely negated by the dcache layer anyway. So why not use a real
filesystem, eliminate the devfs code and the extra filesystem, and
dispense with the "tar cf" kludge?

I think everyone has agreed that a daemon needs to exist, which is
userspace, has some sort of interface to the kernel to be notified about
additions and deletions and creates a /dev based on user policy. Do you
agree with this? Does anyone disagree with this?

The main thing which we are missing right now is a standard interface
where the kernel can dump out all devices in some standard form, and
notify user-space programs when new devices have appeared. That's the
only kernel level support we need, and sure, some of Richard's devfs
patches could be used to help give us this dynamic notification
capability. I claim that there are better interfaces than readdir() +
stat() and a dynamic filesystem in order to pass this information to
userspace, though, and I hope most people would agree with me. Why
don't we try to design that interface first, and I suspect the rest will
follow relatively easily.

- Ted

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:54    [W:0.118 / U:6.608 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site