Subject: Re: poolifying fileassoc
To: None <blymn@baesystems.com.au>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: tech-kern
Date: 10/04/2006 11:42:40
> On Wed, Oct 04, 2006 at 12:39:28AM +0900, YAMAMOTO Takashi wrote:
> > 
> > what's "vmlock"?
> > 
> 
> Sorry, my bad for being vague, I mean that I get a panic saying that a
> simple lock is held if I have LOCKDEBUG defined.  This panic seems to
> be coming from malloc() when I try to use vfs_composefh_alloc() when I
> try to perform a per page check during uvn_getpages().  From what I
> can see this is not a bug - the LOCKDEBUG code is detecting something
> that should not be done in that context.

iirc, what you want to do is something about unreliable backing store, right?
i doubt if you really need to call fileassoc with spin locks held
because, in general, i/o from/to backing store can't be done with
spin locks held.

> My thinking is that I need
> to have some preallocated resources to avoid performing a malloc in
> fileassoc_file_lookup(), to me using a pool looked like the correct
> thing to do.  I can then use this preallocated resource to provide
> storage to vfs_composefh() to fill in the file handle for me.  This
> storage is only required during the fileassoc_lookup_file() call so
> the number of preallocated structures should only need to be
> relatively small.

how do you know how much preallocation is needed?

YAMAMOTO Takashi