Subject: Re: NetBSD1.6 UVM problem?
To: Chuck Silvers <chuq@chuq.com>
From: Greg A. Woods <woods@weird.com>
List: tech-kern
Date: 12/08/2002 20:09:59
[ On Sunday, December 8, 2002 at 11:02:54 (-0800), Chuck Silvers wrote: ]
> Subject: Re: NetBSD1.6 UVM problem?
>
> yes, the heuristic for determining when to start killing processes
> when no swap is available doesn't work so well when there's no swap
> configured. in this case, it would be useful to count RAM that isn't
> reserved for other usage types as potentially available for swap-backed
> allocation. all the places in uvm_fault() that return ENOMEM currently
> use "uvmexp.swpgonly == uvmexp.swpages" as the indicator that sleeping
> won't free up any more memory that could be used for anons, but when
> there's no swap then both sides of that comparison are always zero.
>
> we could replace that with something more like
>
> int t;
>
> t = uvmexp.active + uvmexp.inactive + uvmexp.free;
> if (uvmexp.swpgonly == uvmexp.swpages &&
> uvmexp.filepages <= ((t * uvmexp.filemin) >> 8) &&
> uvmexp.execpages <= ((t * uvmexp.execmin) >> 8)) {
> return ENOMEM;
> }
>
> (and yea, I should make some macros for doing the fixed-point math.)
> this means that we will only start killing processes when swap is full
> and the file and exec pages have been reduced to their minimum levels.
>
> does that do anything useful for you?
Oh, yes please! I think this will help a lot!
--
Greg A. Woods
+1 416 218-0098; <g.a.woods@ieee.org>; <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of the Weird <woods@weird.com>