Re: /proc and /kern

Albert D. Cahalan (
Thu, 3 Dec 1998 11:46:02 -0500 (EST)

Mirian Crzig Lennox writes:

> Anyway, the question I have is this: I would like to work on splitting
> /proc into /proc and /kern, such that /proc is only for process
> information and /kern is for kernel structures. Not only will this be
> more elegant and less cluttered, but it will give proc and kern their
> own separate pools of inodes.

That is a nice idea.

> I realize that this could cause a major flag day since lots of stuff
> depends on /proc, so I propose to make it configurable (either compile
> time configurable or maybe mount time if possible), so that initially
> people would only turn it on when they were trying to find out what
> would break.

Oh no. The whole world breaks.

After 2.2 ships, you can make the procfs code hide non-process files
when you mount /proc. You can only hide them, not remove them.
The procfs code can support /kern too, by hiding process files.

You should _not_ use a mount option for this, since that would make it
hard to split the filesystems apart later. Instead, just have the procfs
code implement both. (like the sysv filesystem that does xenix & coherent)
Well, maybe a mount option to enable full visibility.

You might be able to drop support for the old /proc files in Linux 3.0.
At the very least, you'd need to wait until all the documentation is
updated. (note that binary patching this is easy)

> Another thought I had is to make the pseudo files in /proc and /kern
> display real size information instead of 0, as they do under BSD,
> since I often find it's useful to know roughly how much virtual
> information is "contained" in those files without actually having to
> look at the contents or pipe the contents through a program.

You can only do that if you change the format to contain fixed length
records. It would not be reasonable to create the data every time
somebody does "/bin/ls -l /proc /kern".

Perhaps the file type should change to a non-regular file.
Character devices, sockets, and named pipes are all OK.

Note to all /proc hackers: It would be really nice to get a link
(like /proc/*/exe and /proc/*/root) to the tty. That would really
help tools like ps.

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