On Friday 14 March 2003 08:18, Juli Mallett wrote:
> * De: Eivind Eklund <eivind@FreeBSD.org> [ Data: 2003-03-14 ]
> [ Subjecte: Re: cvs commit: src/sys/vm vm_map.c vm_map.h
> vm_pageout.c ]
>
> >
> > Having had as my workstation a FreeBSD machine with X, netscape,
> > and too little RAM, I think it would be very useful for some
> > situations. You have no idea how annoying it is when netscape eats
> > all your memory and FreeBSD decide that the solution to this is to
> > kill *X*.
>
> I've had that happen for me (though the combinations required are a
> lot lower, as my RAM is a lot lower :>), and that's why I started
> looking into this. I didn't realise my name had been dragged into
> this until just now :)
I have a similar-intentioned set of changes in a 4.x-based tree here.
Our problem is similar to Eivind's except it's Squid that is getting
killed, and Squid is the entire reason the box exists. I took the
simple kernel way to protecting processes:
o Add a flag in the proc struct signalling 'don't kill me'. This flag
is not inheritable. (I recycled the now-deprecated P_NOSWAP flag for
this).
o Provide a mechanism for a process to set this flag. Require root to
prevent the world from setting it willy-nilly. (I [ab]used madvise for
this, since it already "dorks with memory settings". Better interfaces
could probably be found.)
o Hack squid and a few other essential and potentially large programs
(such as bind) to set this flag.
This change effectively stopped our system from committing suicide,
encouraging it to kill off worker-slave processes that can be restarted
when load reduces instead of killing the heart of the box. I can work
up a patch if someone would like to see this on a recent system.
--
"Where am I, and what am I doing in this handbasket?"
Wes Peters wes@softweyr.com
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-src" in the body of the message