lkml.org 
[lkml]   [2000]   [Feb]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: What /proc should contain [was: /proc/driver/microcode]
On Wed, 23 Feb 2000, Erik Andersen wrote:
>On Wed Feb 23, 2000 at 01:59:02PM +1100, Richard Gooch wrote:
>> I don't agree. /proc should be for processes and *nothing* else.
>
>This is certainly how it is in BSD. /proc has only process
>information. All the little knobs that Linux places in /proc
>(for example "echo 1 > /proc/sys/net/ipv4/ip_forward") the
>BSDs set via sysctl (which seems like the Right Thing(tm)).

That is _exactly_ what /proc is supposed to be. Years ago when procfs was
just being introduced, that was it's sole purpose -- access to process
information without having to root through /dev/kmem to walk the process
tree in kernel space.

It has become nothing less than a run-down slum of the linux kernel. Every-
body and everything is buried in /proc and accessed via the stupidest and
most _inefficient_ mean imaginable. Case in point, how do you tell how
many processors are in the machine? (this _is_ a simple ulong in kernel
space.) [Answer: parse an arch dependant /proc/cpuinfo wasting several
thousand times the cpu necessary to copy a fucking number.]

But I digress...

>I encourabe everyone on the list to log into a FreeBSD box,
>and do a "ls /proc", then type "sysctl -a".

I don't need to, I work in a solaris world.

/proc is an evil abomination. Unfortunately, there are too many people to
kill to straighten this mess out -- and nothing to stop it from devolving
in the future.

>Any reason that this file could not be replaced with
> rtc/rtc_time
> rtc/rtc_date
> rtc/rtc_epoch
> etc...

No, but /proc/rtc (and 150% of the other shit in /proc) is designed for
human interaction. That's perfectly ok as long as you provide an interface
designed for non-humans. Gee, how much of a speed up could be seen if
there weren't all this needless sprintf() and sscanf() stupidity being
forced into every application on the drive?

Just look at 'free' for god sake... how many programs need memory util
stats?

--Ricky



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:56    [from the cache]
©2003-2011 Jasper Spaans