From jlemon@americantv.com  Sun Apr 13 21:33:47 1997
Received: from sumatra.americantv.com (sumatra.americantv.com [199.184.181.250])
          by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id VAA14121
          for <FreeBSD-gnats-submit@freebsd.org>; Sun, 13 Apr 1997 21:33:45 -0700 (PDT)
Received: (from jlemon@localhost) by sumatra.americantv.com (8.7.6/8.7.3) id XAA09320; Sun, 13 Apr 1997 23:47:28 -0500 (CDT)
Message-Id: <199704140447.XAA09320@sumatra.americantv.com>
Date: Sun, 13 Apr 1997 23:47:28 -0500 (CDT)
From: jlemon@americantv.com
Reply-To: jlemon@americantv.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: MFS chews up all swap space
X-Send-Pr-Version: 3.2

>Number:         3278
>Category:       kern
>Synopsis:       mounting MFS uses up swap space
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Apr 13 21:40:01 PDT 1997
>Closed-Date:    Sun Apr 19 12:49:07 PDT 1998
>Last-Modified:  Sun Apr 19 12:49:19 PDT 1998
>Originator:     Jonathan Lemon
>Release:        FreeBSD 3.0-CURRENT i386
>Organization:
>Environment:

	FreeBSD 3.0-CURRENT #0: Sun Apr 13 21:55:38 CDT 1997
	
	Machine with 32M memory, 71M swap

>Description:

	Mounting MFS filesystem causes roughly 2x physical memory to
	be allocated in swap partition, even though almost nothing 
	is running.  System then slowly runs out of swap, resulting in
	signal 6's to most processes, and cumulates with a panic in
	update that ususally looks like:

		lockstatus(34)
		ufs_islocked()
		vfs_msync()
		sync()
		vfs_update()

	
>How-To-Repeat:

	# grep swap /etc/fstab    
	/dev/sd3s2b             none            swap    sw              0 0

	# swapinfo
	Device      1K-blocks     Used    Avail Capacity  Type
	/dev/sd3s2b     73728        0    73664     0%    Interleaved
 
	# mount -t mfs /dev/sd3s2b /tmp    

	# swapinfo
	Device      1K-blocks     Used    Avail Capacity  Type
	/dev/sd3s2b     73728    68184     5480    93%    Interleaved

	# umount /tmp

	# swapinfo    
	Device      1K-blocks     Used    Avail Capacity  Type
	/dev/sd3s2b     73728    10488    63176    14%    Interleaved

>Fix:
	
	Don't use MFS, until fixed.

>Release-Note:
>Audit-Trail:

From: Luigi Rizzo <luigi@labinfo.iet.unipi.it>
To: jlemon@americantv.com
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: kern/3278: MFS chews up all swap space
Date: Mon, 14 Apr 1997 11:46:25 +0200 (MET DST)

 > >Environment:
 > 
 > 	FreeBSD 3.0-CURRENT #0: Sun Apr 13 21:55:38 CDT 1997
 > 	
 > 	Machine with 32M memory, 71M swap
 > 
 > >Description:
 > 
 > 	Mounting MFS filesystem causes roughly 2x physical memory to
 > 	be allocated in swap partition, even though almost nothing 
 ...
 > 	update that ususally looks like:
 > 
 > 	# grep swap /etc/fstab    
 > 	/dev/sd3s2b             none            swap    sw              0 0
 > 
 > 	# swapinfo
 > 	Device      1K-blocks     Used    Avail Capacity  Type
 > 	/dev/sd3s2b     73728        0    73664     0%    Interleaved
 >  
 > 	# mount -t mfs /dev/sd3s2b /tmp    
 
 hmmm... don't you have to specify the size of the file system you want
 to create ? Otherwise the code tries to infer the size from the info it
 has available (swap partition size, or some other thing).
 
 This works perfectly for me:
 
 	mount -t mfs -o "-s 20480" /dev/wd0s1b /tmp/aa
 
 BTW the manpage for mount_mfs contains a mistake in the EXAMPLES
 section, the size must be specified without the equal sign
 
     WRONG: mount_mfs -s=20480 -o nosuid,nodev /dev/sd0b /tmp
     RIGHT: mount_mfs -s 20480 -o nosuid,nodev /dev/sd0b /tmp
 
 If one really wants to make things smoother, probably newfs.c should
 be modified (around line 431) so that the default value for mfs
 file systems is just a fraction (say 1/3 .. 1/2) of the partition
 size (that's a default so it can be easily overridden). As an
 example (in pseudo diff -u):
 
 newfs.c from 2.2.1-RELEASE, line 431:
 
  	        if (fssize == 0)
 -			fssize = pp->p_size;
 +			fssize =  mfs ? pp->p_size / 2 : pp->p_size ;
 		if (fssize > pp->p_size && !mfs)
 
 
 	Cheers
 	Luigi
 -----------------------------+--------------------------------------
 Luigi Rizzo                  |  Dip. di Ingegneria dell'Informazione
 email: luigi@iet.unipi.it    |  Universita' di Pisa
 tel: +39-50-568533           |  via Diotisalvi 2, 56126 PISA (Italy)
 fax: +39-50-568522           |  http://www.iet.unipi.it/~luigi/
 _____________________________|______________________________________

From: Jonathan Lemon <jlemon@americantv.com>
To: Luigi Rizzo <luigi@labinfo.iet.unipi.it>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: kern/3278: MFS chews up all swap space
Date: Mon, 14 Apr 1997 14:59:20 -0500

 On Apr 04, 1997 at 11:46:25AM +0200, Luigi Rizzo wrote:
 > This works perfectly for me:
 > 
 > 	mount -t mfs -o "-s 20480" /dev/wd0s1b /tmp/aa
 
 I'll have to try that.  However, I've been running with the same fstab 
 entry since about 2.1.5, without any problems.  A version of -current 
 right before the Lite2 merge (when I quit running -current for a while)
 does not exhibit this problem.
 --
 Jonathan
State-Changed-From-To: open->closed 
State-Changed-By: phk 
State-Changed-When: Sun Apr 19 12:49:07 PDT 1998 
State-Changed-Why:  
timed out 
>Unformatted:
