Subject: Re: poolifying fileassoc
To: None <blymn@baesystems.com.au>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: tech-kern
Date: 04/08/2007 20:16:07
> > 
> > why you need to check UVMPAGER_ASYNCIO_DONE here?
> > 
> 
> Because in the original code uvm_aio_iodone() would unconditionally
> release the page but in the genfs_getpages() the pages are only
> released if they have PG_FAKE set.

in the former case, the pages are always PG_FAKE set because genfs_getpages
skips !PG_FAKE pages.

> > > +/* Flags to uvm_io_done */
> > > +#define UVMPAGER_SYNCIO_DONE	0x01	/* Synch i/o has completed */
> > > +#define UVMPAGER_ASYNCIO_START	0x02	/* Asynch i/o started */
> > > +#define UVMPAGER_ASYNCIO_DONE	0x03	/* Asynch i/o has completed */
> > > +
> > 
> > can you explain "Asynch i/o started"?
> > to me, it seems to be used only when async getpages found all pages cached.
> > ie. no i/o is started.
> > 
> 
> No, from what I can see, if the flags to genfs_getpages() does not
> have PGO_SYNCIO set then genfs_getpages() will start an asynch i/o
> with a callback of uvm_biodone() when the i/o is completed.
> uvm_biodone() then schedules puts an entry on a work queue for
> uvm_aio_aiodone() to be called.  So, from what I can see we need to
> know if PGO_SYNCIO was set to ensure we do not do operations on pages
> that are not brought in yet and also need to know when we are being
> called to complete an asynch operation so we can unbusy the pages and
> other actions that could not be done before the pages are present.

in that case, your uvm_aio_aiodone uses UVMPAGER_ASYNCIO_DONE,
not UVMPAGER_ASYNCIO_START.

YAMAMOTO Takashi