Subject: Re: swap space for a memory based filesystem
To: Jaromir Dolecek <>
From: None <>
List: tech-userlevel
Date: 03/02/2004 18:27:11

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

This goes on even if we issue sync command (wasnt it supposed to write back
these dirty pages back to disk ?)
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 ..

My questions /:
what happens further is that if say a program asks for memory it goes down
saying out of swap ??
so why isnt the file system being written back to ??
Could declaration of no swap affecting the vnode handling by netbsd ??
we dont have swap declared / mounted is all I can see as a difference
between a server runinng netbsd where also repetitive file copies does
decreases memory free as reported by top but after a point the error shown
is file system full and not out of swap, as we are getting here ..
could we be giving something in kernel options which could have resulted
this ?
What is this File field anyways, how is it calculated and how is the free
field calculated, this seems to be different from linux ..

why isnt it saying file system full (which isnt) as df -k shows some life
left ..
Please point to some relavant direction.

I read some where that netbsd vm implementation could screw up if there is
no swap,
but even I believe what u are saying and was resisting doing it ..
but the fact that my process are not getting memory after I create a file
is troubling me and was thinking of trying this swap creation ..

any comments ..
its been 2 days now with this problem (Jaromir Dolecek) on 03/02/2004 04:27:12 PM

Sent by:

To:    Nitin Mahajan/HSS@HSS

Subject:    Re: swap space for a memory based filesystem wrote:
> We have a system which boots using memory based file system,
> i.e we have a ramdisk having some file system mounted on it and
> for it passed via kernel options file ..
> but I couldnt find any option / way to define swap partition and space
> same ..
> could some one please tell me how to declare and allocate space for swap
> for it ?
> I couldnt find any  relavant option in swapctl and swapon ..  ?

It's probably not very useful to have swap on MFS - it just wastes
additional memory for swap structures. You can safely run without
any swap configured.

Jaromir Dolecek <>  
-=- We should be mindful of the potential goal, but as the Buddhist -=-
-=- masters say, ``You may notice during meditation that you        -=-
 -=- sometimes levitate or glow.   Do not let this distract you.''   -=-