From owner-cvs-src Mon Mar 17 11:56:48 2003 Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2C14437B401; Mon, 17 Mar 2003 11:56:43 -0800 (PST) Received: from mail01.stbernard.com (mail01.stbernard.com [64.154.93.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id E259943F3F; Mon, 17 Mar 2003 11:56:41 -0800 (PST) (envelope-from wes@softweyr.com) Received: from salty.rapid.stbernard.com ([192.168.4.61]) by mail01.stbernard.com with Microsoft SMTPSVC(5.0.2195.5329); Mon, 17 Mar 2003 11:56:41 -0800 From: Wes Peters Organization: Softweyr.com To: Juli Mallett , Eivind Eklund Subject: Re: cvs commit: src/sys/vm vm_map.c vm_map.h vm_pageout.c Date: Mon, 17 Mar 2003 11:56:40 -0800 User-Agent: KMail/1.5 Cc: Mike Silbersack , David Schultz , src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org References: <200303122313.h2CNDHMU046431@repoman.freebsd.org> <20030314012954.A42430@FreeBSD.org> <20030314101857.A98861@FreeBSD.org> In-Reply-To: <20030314101857.A98861@FreeBSD.org> X-Habeas-SWE-1: winter into spring X-Habeas-SWE-2: brightly anticipated X-Habeas-SWE-3: like Habeas SWE (tm) X-Habeas-SWE-4: Copyright 2002 Habeas (tm) X-Habeas-SWE-5: Sender Warranted Email (SWE) (tm). The sender of this X-Habeas-SWE-6: email in exchange for a license for this Habeas X-Habeas-SWE-7: warrant mark warrants that this is a Habeas Compliant X-Habeas-SWE-8: Message (HCM) and not spam. Please report use of this X-Habeas-SWE-9: mark in spam to . MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200303171156.40901.wes@softweyr.com> X-OriginalArrivalTime: 17 Mar 2003 19:56:41.0279 (UTC) FILETIME=[540C34F0:01C2ECBF] Sender: owner-cvs-src@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Friday 14 March 2003 08:18, Juli Mallett wrote: > * De: Eivind Eklund [ 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