Subject: kern/15503: uvm_anon_add: can not allocate 179199 anons
To: None <gnats-bugs@gnats.netbsd.org>
From: None <makoto@ki.nu>
List: netbsd-bugs
Date: 02/06/2002 11:37:30
>Number:         15503
>Category:       kern
>Synopsis:       panic: uvm_add_anon with big swap ( > 512M ?)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 05 18:38:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Makoto Fujiwara
>Release:        NetBSD 1.5.2 and 1.5.3_ALPHA
>Organization:
	www.ki.nu
>Environment:
	
	System: 
	NetBSD harry 1.5.3_ALPHA NetBSD 1.5.3_ALPHA (GENERIC-insecure-modem) #0: 
	Tue Feb 5 14:22:55 JST 2002 
	makoto@harry:/export/src-netbsd-1-5/sys/arch/macppc/compile/GENERIC-insecure-modem 
	macppc
>Description:
	
	1.5.2 release and 1.5.3_ALPHA kernel panics if big swap is defined in /etc/fstab
        ( or later by swapon command). Following example is with 1G swap,
        
	root file system type: ffs
	uvm_anon_add: can not allocate 255999 anons
	panic: uvm_anon_add
	Stopped in swapctl at cpu_Debugger+0x10:      lwz r0, r1, 0x14,
	db> trace
	at panic+e8
	at uvm_anon_add+a0
	at sys_swapctl+864
	at sys_swapctl+420
	at trap+400
	at ddblow+e0
	....

>How-To-Repeat:
	
	boot 1.5.2 or 1.5.3_ALPHA to multiuser with big swap defined.
       ( I have tested with 720M and 1G).
>Fix:
	
	pull the changes described in
	http://mail-index.netbsd.org/source-changes/2000/12/27/0029.html	
	say, 
	uvm/uvm_anon.h 1.12 -> 1.13
	uvm/uvm_anon.c 1.10 -> 1.11
	uvm/uvm_swap.c 1.42 -> 1.43

	By this fix, kernel won't panic, but swapctl will say,
	/dev/wd0b: Cannot Allocate memory
	and swap still won't be attached.
>Release-Note:
>Audit-Trail:
>Unformatted: