Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 Mar 2006 17:51:38 +1100
From:      Peter Jeremy <peterjeremy@optushome.com.au>
To:        Dmitry Pryanishnikov <dmitry@atlantis.dp.ua>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: RELENG_4 on flash disk and swap
Message-ID:  <20060304065138.GD692@turion.vk2pj.dyndns.org>
In-Reply-To: <20060304001224.G356@atlantis.atlantis.dp.ua>
References:  <20060302181625.I3905@atlantis.atlantis.dp.ua> <76FAD2DB-CD18-42D4-95C8-F016CFB17B00@segpub.com.au> <20060303110936.R86586@atlantis.atlantis.dp.ua> <20060303185157.GB692@turion.vk2pj.dyndns.org> <20060304001224.G356@atlantis.atlantis.dp.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
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
expected.

> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060304065138.GD692>