Re: proc_generic - cool new stuff

root (root@fomalhout.lunix.org)
9 Nov 1996 19:41:19 -0000


In article <XFMail.961106063146.rriggs@tesser.com>,
rriggs@tesser.com (Rob Riggs) writes:
> OK... proc_generic version 2 is here.
>
> This version offers cached and non-cached operation as well as
> a new toy I have been working on... proc fifos. This little
> gadget is great for logging kernel info and not filling up
> the log files or causing klogd/syslogd undue strain. I have
> implemented one in the sbpcd code for your wonderment.
>
> I have also (for Alan's sake) implemented /proc/net/route using
> the new non-cached model . When working for non-cached proc
> routines, proc_write() writes directly into the user buffer, and
> therefore must be OK to sleep in. It definitely cannot use cli/sti
> to lock it's tables. Anything still relying on cli/sti will need
> to be cached. (And hopefully some of these will be fixed by Keith
> Owens soon.)
>
> With the new non-caching code, a user routine can swallow the
> whole proc output in one read, if it finds it necessary. This
> will keep the proc data consistent (no missing or duplicate data),
> as was the original intent of the caching model.
>
> The included patch should apply cleanly to 2.1.7.
>
> Comments?

Yes,

what is to stop someone from finding the biggest cached /proc entry
(maybe there is even one you can cause to be big), open that one as many
times as he is allowed to open a file and not close it ?
Depending on how big the /proc entry is, he might drive the kernel out of
memory.

Ton
.