Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Mar 2003 11:56:40 -0800
From:      Wes Peters <wes@softweyr.com>
To:        Juli Mallett <jmallett@FreeBSD.org>, Eivind Eklund <eivind@FreeBSD.org>
Cc:        Mike Silbersack <silby@silby.com>, David Schultz <das@FreeBSD.org>, src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/vm vm_map.c vm_map.h vm_pageout.c
Message-ID:  <200303171156.40901.wes@softweyr.com>
In-Reply-To: <20030314101857.A98861@FreeBSD.org>
References:  <200303122313.h2CNDHMU046431@repoman.freebsd.org> <20030314012954.A42430@FreeBSD.org> <20030314101857.A98861@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200303171156.40901.wes>