Subject: RE: Problems with MFS in 1.6 ?
To: 'Chuck Silvers' <chuq@chuq.com>
From: Sylvain Fontaine <sfontaine@hyperchip.com>
List: port-macppc
Date: 12/04/2002 15:34:09
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