Subject: Re: UVM failure :(
To: None <port-pmax@netbsd.org>
From: Simon Burge <simonb@telstra.com.au>
List: port-pmax
Date: 11/27/1998 20:58:26
On Mon, 02 Nov 1998 18:58:17 +1100  matthew green wrote:

> 
>    > i booted a UVM kernel (same very -current sources as the non-UVM kernel
>    > i successfully booted only hours ago) on my /240 and it didn't like me:
>    > 
>    > root file system type: ffs
>    > init: copying out path `/sbin/init' 11
>    > uvm_anon_add: can not allocate 50999 anons
>    > panic: uvm_anon_add
>    > 
>    > this would have been while swapctl was running ... 
>    > 
>    > i'll have more details when i look deeper at it.
>    
>      Have you found out anything more about this?
> 
> only in so far that it runs out of kernel memory.
>    
>      I just took a look at uvm_anon_add(), and it looks like it's trying
>    to allocate 50999 pages (!).   As far as I can tell, this only comes
>    from swap_on() in uvm_swap.c.  Ah, I wonder if that expression to
>    calculate the number of pages might be messing up?  It looks like it's
>    trying to convert the number of blocks to a 64 bit value, convert to
>    the number of bytes, and then shift by PAGE_SHIFT to get the number of
>    pages.  Any bets there's an error in that expression somewhere (either
>    a code generation bug or something incorrect in the expression -
>    presumably mips-specific)?  [Ugh - I'm too tired to try to figure out
>    just what the assembly code is doing.]
> 
> 
> not 50999 pages, but 50999 anons -- one for each physical page of
> swap space i have... (~200M).  this is "normal" .. but appears to
> be blowing out my kernel map :-(

Time for me to join the club :(

I just tried to boot a -current kernel on my /240 and got the same
panic, also right after the root-fs was mounted (I assume init was
running - the kernel doesn't have DEBUG on so I don't see that message).

I got the following:

	uvm_anon_add: can not allocate 51239 anons
	panic: uvm_anon_add

51239 * 4 = 204956, and:

	mona:~ 24> swapctl -l
	Device      1K-blocks     Used    Avail Capacity  Priority
	/dev/rz0b      204960        4   204956     0%    0

Time to start looking - maybe it's a /240 thang :)

Simon.