Subject: Re: tmpfs: Internal representation of data
To: Simon Burge <simonb@wasabisystems.com>
From: Matt Thomas <matt@3am-software.com>
List: tech-kern
Date: 07/20/2005 16:10:42
Simon Burge wrote:
> Matt Thomas wrote:
>>
>>I would use pools, not malloc/free.
> 
> 
> Have you considered using UVM anonymous memory objects (aobjs) instead
> of pools and malloc/free?  Pools and malloc both use wired memory only,
> whereas an aobj can be pageable.
> 
> There was some discussion about this ages ago on tech-kern.  Some
> starting points are:
> 
>  http://mail-index.netbsd.org/tech-kern/2000/03/14/0001.html
>  http://mail-index.netbsd.org/tech-kern/2000/03/20/0000.html

One thing to consider is that on platforms with much more physical
memory than addressable virtual memory (cough, i386), pageable data
doesn't really help you.  You'll run out of kernel VM long before
physical memory.

If you make your filespace allocator use physical pages, you have
the advantage of just keeping the physical page around without a
virtual mapping.  There's nothing that prevents you from swapping
these physical pages out yourself, but it would be nice if the
system could that.  One thing to consider is that unlike normal
VM usage, you don't have to worry about a page of file-data being
double mapped into multiple files. This can simplify a design
considerably.

The limitation of the tmpfs size should the amount in the system,
not the amount of kernel VM space.
-- 
Matt Thomas                     email: matt@3am-software.com
3am Software Foundry              www: http://3am-software.com/bio/matt/
Cupertino, CA              disclaimer: I avow all knowledge of this message.