Messages in this thread | | | From | Andi Kleen <> | Subject | Re: sed not working on /proc files | Date | Sat, 1 May 1999 15:47:49 +0200 |
| |
In muc.lists.linux-kernel, you wrote: >Hi, > >On Mon, 26 Apr 1999 17:17:10 -0400, Chip Salzenberg ><chip@perlsupport.com> said: > >> Hm. Would it be a Bad Thing for mmap to fail on /proc files that >> don't report true sizes? > >We don't need to support mmap for /proc at all. In fact, according to >mmap semantics, we can't: there is no permanent memory reserved for >/proc at all.
mmap'ed /proc would be a nice way to implement efficient access to some of the system statistics for programs that read them often (the read seems to be a bottle neck for some programs, like wmcpu)
Implementing it would be a nightmare though: e.g. how do you guarantee consistency of data between the "data updaters" in the kernel and the user processes?
A better strategy is most likely to move more and more of the information into read-only sysctls. Then they can be still accessed via /proc/sys/*, and program needing more efficient access can use sysctl(2).
This also would map nicely onto a "Linux-MIB" for remote network control.
A generic compatibility layer between sysctl.c and fs/proc/array.c would be probably rather easy and a nice 2.3 project for someone (so that most of the old /proc stuff would just be a simple table driven wrapper around the sysctl data structures)
-Andi
- 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/
| |