Subject: Re: /dev on tmpfs problem
To: None <dan@geek.com.au>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: tech-kern
Date: 11/14/2005 08:34:30
> > note that allocating memory for tmpfs implies
> > reclaiming other use of memory including file cache.
> 
> Indeed.  Since that has to happen anyway, why do we need another knob?

because the desired size of tmpfs can not be calculated from
the total amount of memory.
IMO using tmpfs without -s is somewhat useless.

> Is there a reason tmpfs can't consider (clean) filecache pages above
> filemin or filemax as "free" for it's purposes (assuming no explicit
> -s was given, of course)? Perhaps there is a reason, like we can't
> sleep for free pages at the relevant point, but if that's so I can't
> see that tmpfs can work even with swap.

filemin/max is not related.

> This makes a very clear concept for the user: vm.file* pages are to be
> used for filecache, and tmpfs looks just like filecache but backed by
> swap rather than files.  Therefore, dirty tmpfs pages should reclaim
> clean filecache pages. If there's swap to back them, idle tmpfs pages
> should eventually get cleaned and the space reused for more active
> files or other needs.

- tmpfs pages are counted as anon pages.
- i don't think that vm sysctl is a clear concept for users anyway. :-)

> If I use tmpfs with no backing swap, I have to recognise that I might
> fill my filecache memory with tmpfs files that can't be paged out, and
> thus starve myself of other cache or memory needs; I can use -s to
> limit the size allocated to tmpfs to help here, if I want.

you have to do so unless you have infinite amount of swap.

YAMAMOTO Takashi