From owner-freebsd-hackers Wed Sep 22 11:35:48 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id 8644114EB3 for ; Wed, 22 Sep 1999 11:35:46 -0700 (PDT) (envelope-from bright@wintelcom.net) Received: from localhost (bright@localhost) by fw.wintelcom.net (8.9.3/8.9.3) with ESMTP id LAA21365; Wed, 22 Sep 1999 11:52:13 -0700 (PDT) Date: Wed, 22 Sep 1999 11:52:12 -0700 (PDT) From: Alfred Perlstein To: Nate Williams Cc: Chuck Robey , "Daniel C. Sobral" , Ivan , Matthew Dillon , freebsd-hackers@FreeBSD.ORG Subject: Sleeping in low memory situations (was re: 3.3 lockups + X) In-Reply-To: <199909221727.LAA14290@mt.sri.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Wed, 22 Sep 1999, Nate Williams wrote: > > > What kind of resources are there that both cause loss of swap AND are > > > freed up by sleeping a process? > > > > four things i can think of: > > > > 1) Along with 'SIGDANGER' it allows the system to fix itself. > > That's another issue. Don't mix sleeping processes with SIGDANGER, they > are independant of one another. > There's no mention of SIGDANGER, just of pu Why not? It's much more friendly... > > 2) Allow the operator to determine which program to kill, maybe the > > 'hog' is actually something that needs to run to completion and > > by shutting down other systems it would survive. > > The operator can't kill anything, since the system would be unusable at > that point, being out of resources and all. His shell wouldn't even > run. That's untrue, a syscall doesn't take memory, if there was a prompt already available it would be possible to issue a 'kill %job' to stop it. Not only that but perhaps reserving an amount of backing store for root may be a good idea, artificially limit the resources to several pages to enable root to actually do something in such a situation. > > 3) other processes may exit, this would free the memory needed to > > continue. > > Maybe, and then again, maybe not. A program is requesting memory, so > putting other processes to sleep *keeps* them from freeing up memory. I didn't say putting others to sleep, I said putting the requestor to sleep. > > 4) the operator could enable swap on an additional device giving > > more backing for things to continue. > > See above. There are no resources available for anything to run, so the > system must do *SOMETHING*. You're right, point 4 is bogus unless you consider reserved backing for root. When the reserved backing is used up moving to a kill would be necessary. I really hope people aren't taking this as a total solution, I just wanted to bring something up for discussion, putting the process to sleep isn't the entire answer, but mixed with other measures it could make for a nice alternative than the kill anything approach. I also know that this is somewhat flawed as I'm pretty sure that there are many places where there is no reference to the requestor, that is a problem right? The problem is that all i'm getting is reasons not to do this, I'd appreciate 2 kinds of feedback: 1) references to an implementation that tried this and failed or succeeded. 2) additional ideas on how to best implement this. (I particularly like my idea of artificially limiting non root processes.) :) We have the best minds in the world working on FreeBSD, surely we can find a suitable alternative. -Alfred To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message