RELENG_4 on flash disk and swap

Peter Jeremy peterjeremy at
Sat Mar 4 06:51:50 UTC 2006

On Sat, 2006-Mar-04 00:25:01 +0200, Dmitry Pryanishnikov wrote:
>On Sat, 4 Mar 2006, Peter Jeremy wrote:
>>swap space for a process and failed.  The kernel tries to recover by
>>killing the largest process (which should also be syslog'd).  I'm
> In my case, not a single process has been killed. And I suppose
>that I know why...

Once swap_pager_full is set (which it has been in your case), the
kernel will kill processes if it thinks it's short of memory, defined
as (the following are all sysctl names):
vm.stats.vm.v_free_reserved + vm.stats.vm.v_cache_min >
vm.stats.vm.v_free_count + vm.stats.vm.v_cache_count

>... because I think it wasn't a process which requested a page - it
>apparently was a softupdates code.

Or possibly the dirhash code - it also needs RAM.

> Do you really believe that RELENG_4
>lacks real memory for "make buildworld" on i386 with 256Mb RAM?

No.  It seems fairly unlikely but it's been a long while (probably pre
4.x) since I've tried building world in a limited memory environment.
g++ can eat lots of memory and I know ld used to.  It seemed less
likely that rm would fill up your memory.

> My diagnostics (swap_pager_getswapspace: 
>failed) occurs only once per OS run (it doesn't repeat until I reboot by 
>box), and even with vm.swap_enabled=0!

My reading of the code suggests that swap_pager_full (which triggers the
message) will not be reset unless you have some swap so this would be

> So I think it's harmless, I just 
>want to confirm it w/o digging OS vm code.

Once you've received this message, the OS is free to kill your
processes until it frees up some swap (which it can't do if you don't
have any).  I suggest you have a quick look through vm/swap_pager.c
and vm/vm_pageout.c, looking at swap_pager_full and swap_pager_almost_full.

Peter Jeremy

More information about the freebsd-stable mailing list