Bug 20273

Summary: swap
Product: Base System Reporter: dancy <dancy>
Component: kernAssignee: Matt Dillon <dillon>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.0-RELEASE   
Hardware: Any   
OS: Any   

Description dancy 2000-07-29 00:10:01 UTC
System panics during bootup:

swapon... /dev/wd0s1b
panic: blst_radix_free: freeing free block
mp_lock=01000001; cpuid=1; lapic.id=01000000
boot() called on cpu #1

syncing...
etc

If I comment out the fstab entries for those two partitions, the system
boots fine. 
If I erase the two partitions and make one big giant one that's all swap,
the system boots fine.

Fix: 

Unknown
How-To-Repeat: 
I can delete the partitions and remake them (using /stand/sysinstall) and the 
problem will persist.
Comment 1 Sheldon Hearn freebsd_committer freebsd_triage 2000-08-02 21:05:12 UTC
Responsible Changed
From-To: freebsd-bugs->dillon

Matt's code, he'll know what questions to ask.
Comment 2 Tor Egge 2000-10-11 02:50:44 UTC
----Next_Part(Wed_Oct_11_03:50:20_2000)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit


This problem is caused by incorrect calculation of nswap (by not taking
the device stripe size into account).

- Tor Egge


----Next_Part(Wed_Oct_11_03:50:20_2000)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Index: sys/vm/vm_swap.c
===================================================================
RCS file: /home/ncvs/src/sys/vm/vm_swap.c,v
retrieving revision 1.104
diff -u -r1.104 vm_swap.c
--- sys/vm/vm_swap.c	2000/05/05 09:59:14	1.104
+++ sys/vm/vm_swap.c	2000/10/11 00:02:37
@@ -291,8 +291,8 @@
 	 * DEV_BSIZE'd. 
 	 */
 
-	if (nblks * nswdev > nswap)
-		nswap = (nblks+1) * nswdev;
+	if ((nblks + dmmax) * nswdev > nswap)
+		nswap = (nblks + dmmax) * nswdev;
 
 	if (swapblist == NULL)
 		swapblist = blist_create(nswap);

----Next_Part(Wed_Oct_11_03:50:20_2000)----
Comment 3 Matt Dillon freebsd_committer freebsd_triage 2000-10-13 08:08:53 UTC
State Changed
From-To: open->closed

Committed a patch substantially similar to Tor's suggestion to 
-STABLE.  Will commit to -current momentarily.