[BusyBox] another one on circular buffer syslogd
Erik Andersen
andersen at lineo.com
Thu Jan 4 21:25:11 UTC 2001
On Thu Jan 04, 2001 at 09:43:08PM +0100, Michael Renzmann wrote:
>
> I think it is a bad idea. It may save some bytes for the binary, but
> wastes memory (doesn´t it?).
Some -- but not nearly as much as you think since Linux does copy-on-write
(COW) there is actually just once copy of BusyBox living in the kernel's buffer
cache. Each forked child app (and each busybox process for that matter) uses
the exact same bit of memory (the stuff living in the buffer cache) for the
.text and .data sections. Only the bss and stack space memory is allocated per
process, and even then, since Linux does lazy allocation, pages of memory are
not actually allocated until a process writes to stuff living in .bss. Then,
Linux creates space just for what was written, not the whole bss).
> Another thing: I will change syslogd and klogd to create pid files. If
> either of the one finds an existing pid it will refuse to continue
> starting up. This will prevent multiple processes of syslog/klog running
> at the same time. I think this one will be finished at the beginning of
> the next week (depending on how much time I'll find tomorrow and on
> monday).
Actually, to make this a more valuable exercise, perhaps the world would be
better served if you created a busybox start-stop-daemon app. This way, the
problem can be solved in a more general (and so more generally useful) way.
-Erik
--
Erik B. Andersen email: andersen at lineo.com
--This message was written using 73% post-consumer electrons--
More information about the busybox
mailing list