RELENG_4 on flash disk and swap

Dmitry Pryanishnikov dmitry at atlantis.dp.ua
Sat Mar 4 14:08:15 UTC 2006


Hello!

On Sat, 4 Mar 2006, Peter Jeremy wrote:
> 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

  Oh, I see.

>
>> ... 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.

  I haven't included "options UFS_DIRHASH" in my kernel's config.

>> 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.

  ... but this is what actually happens.

>> 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.

  Now I wander how to tune swapless FreeBSD (say, 4.x, although this part
of the vm subsystem seems to be similar even in CURRENT) to insure that it
won't kill important processes during low memory condition (short of
removing process kill code from vm_pageout_scan())? If I define NO_SWAPPING
in system's config file, it removes too much code (e.g., vm_daemon-related)
so I fear that it'll actually make things worse.


Sincerely, Dmitry
-- 
Atlantis ISP, System Administrator
e-mail:  dmitry at atlantis.dp.ua
nic-hdl: LYNX-RIPE


More information about the freebsd-stable mailing list