Subject: Re: Problems with MFS in 1.6 ?
To: Sylvain Fontaine <sfontaine@hyperchip.com>
From: Chuck Silvers <chuq@chuq.com>
List: port-macppc
Date: 12/04/2002 22:25:45
hi,

paging behaviour is controlled by the vm.{file,exec,anon}{min,max} sysctl
tunables.  see http://mail-index.netbsd.org/tech-kern/2002/12/02/0026.html

in your case, the default vm.filemin of 10% is keeping those MFS pages
from being reused.  if you want to see them being paged out, create a
new 500MB file and then delete the new file.  or set vm.filemin to 0.

-Chuck


On Wed, Dec 04, 2002 at 03:34:09PM -0500, Sylvain Fontaine wrote:
> I tried to force the second copy to be page out,
> And did not succeed.
> 
> Initial State:
> Memory: 594M Act, 4268K Inact, 356K Wired, 608K Exec, 97M File, 345M Free
> 
> 97M File -> with 90M was added here when creating a file of 90M onto MFS
> 
> Then I start a program that allocates 400M, and the task gets killed by
> UVM for absence of memory, and the 90M extra due to cache remains allocated.
> It always remains there.
> 
> Thanks
> Sylvain
> 
> 
> -----Original Message-----
> From: Chuck Silvers [mailto:chuq@chuq.com]
> Sent: Tuesday, December 03, 2002 9:47 PM
> To: Sylvain Fontaine
> Cc: 'port-macppc@NetBSD.org'
> Subject: Re: Problems with MFS in 1.6 ?
> 
> 
> hi,
> 
> On Tue, Dec 03, 2002 at 02:14:52PM -0500, Sylvain Fontaine wrote:
> > I use MFS to mount a ~100M ram disk.
> > 
> > I get a strange behavior in 1.6, which I dont see in 1.5.3,
> > that doubles the memory consumtion on MFS.
> ...
> > Results: 
> > By creatin a MFS drive of ~ 100M, creating a file in it of ~100M, I end up
> 
> > using ~200M....
> > 
> > Is this Normal?
> 
> yes, it's normal.  the same data is in memory twice, once in the MFS process
> and again in the file system cache for the individual files in the MFS.
> this was also the case prior to 1.6 as well, but then the second copy was
> in the buffer cache instead of the page cache, which is managed and reported
> differently.
> 
> when memory gets low, the second copy will be "paged out" to the first copy,
> and the first copy will be paged out to swap space.
> 
> at some point, MFS should be changed to avoid this double memory usage,
> but it's a substantial amount of work.
> 
> -Chuck