Subject: Re: HEADS UP: tmpfs added
To: Matthias Scheler <tron@zhadum.de>
From: Jason Thorpe <thorpej@shagadelic.org>
List: tech-kern
Date: 09/13/2005 10:58:13
On Sep 13, 2005, at 8:36 AM, Matthias Scheler wrote:

> Yes, probably. There's of course a problem with that:
> When "tmpfs" kicks UVM to free a page, UVM might kick UBC to flush  
> a dirty
> page beloging to a vnode of the very same "tmpfs" instance.
>
> Thinking about that further it could already happen right now:
> 1.) The system needs a free page but there are none.
> 2.) UBC tries to write a dirty page to a "tmpfs" instance.
> 3.) "tmpfs" tries to allocate a page to store the date from the  
> dirty page.

The fundamental problem is that tmpfs is using two pages of each page  
of data -- one in the vnode, one in the (swap-backed) aobj.

The pages should simply be always associated with the vnode, with no  
aobj.  I think tmpfs_getpages() and tmpfs_putpages() should interact  
with swap slots directly, cleaning the vnode pages to and faulting in  
from swap.

-- thorpej