Re: [PATCH] 2.5 PROPOSAL: Replacement for current /proc of shit.

Rusty Russell
2001-11-02T01:39:45Z

On Thu, 01 Nov 2001 05:42:36 -0500
Jeff Garzik <jgarzik@mandrakesoft.com> wrote:

> Is this designed to replace sysctl?

Well, I'd suggest replacing *all* the non-process stuff in /proc. Yes.

> In general we want to support using sysctl and similar features WITHOUT
> procfs support at all (of any type). Nice for embedded systems
> especially.

1) My example was implemented as a filesystem. You could just as easily have
a CONFIG_PROC_SYSCALL which implemented access as a syscall, ie. sysctl2().

2) It's not worth the hassle to save 7k of code (well, the final implementation
will be larger than this, but OTOH, your replacement will be non-zero size).

> AFAICS your proposal, while nice and clean :), doesn't offer all the
> features that sysctl presently does.

You're right! My code:

1) Doesn't have the feature of requiring #ifdef CONFIG_SYSCTL in every file
that uses it properly (ie. checks error returns).
2) Doesn't have the feature that compiling without CONFIG_PROC/CONFIG_SYSCTL
wastes kernel memory unless surrounded by above #ifdefs.
3) Doesn't have the feature that it takes over 90 lines to implement a working
read & write.
4) Doesn't have the feature that it's hard to create dynamic directories.
5) Doesn't have the feature that it's inherently racy against module unload.

What was I thinking????
Rusty.