Subject: Re: swap space for a memory based filesystem
To: None <nmahajan@hss.hns.com>
From: None <cube@cubidou.net>
List: tech-userlevel
Date: 03/02/2004 14:28:12
On Tue, Mar 02, 2004 at 06:27:11PM +0530, nmahajan@hss.hns.com wrote:
[...]
> actually what you are saying made sense to me also but we are finding a
> peculiar problem:
> (from my earlier post)
> we are facing a problem in our system runinng netbsd.
> we are trying to create a file on our file system (compact flash mounted
> ffs and memory based file system for system image and NO SWAP mounted !) ..
> 
> we are observing that the file copied decreases the top shown free memory ?
> and increases the File memory shown by top i.e
> Memory: 50M Act, 72M Inact, 220K Wired, 1944K Exec, 110M File, 96M Free
> 
> The File and Free are proportinately increased and decreased by same amount
> respectively.
> 
> This goes on even if we issue sync command (wasnt it supposed to write back
> these dirty pages back to disk ?)

Who says everything classified as 'File' is dirty?  What would be the point
of caching the data if the pages were to be freed immediately after being
written?

> io_flush kernel thread has also been seen running but doesnt changes these
> top output. ..
> the file in question being  say 38 MB .. and command is " cp file1 file 2"
> 
> Can some body explain why it is happening ..

The kernel keeps the cached data.  That sounds rather reasonable to me.

> My questions /:
> what happens further is that if say a program asks for memory it goes down
> saying out of swap ??

Do you actually get such an error, or is it a wild assumption?

[...]
> any comments ..
> its been 2 days now with this problem

Is there a real problem besides the fact that you don't seem to be statisfied
with the data you read because you don't have a good understanding of how the
NetBSD VM works?

Quentin Garnier.