Subject: Re: uvm & flushing
To: Chuck Silvers <>
From: Bill Studenmund <>
List: tech-kern
Date: 12/10/1999 12:11:26
On Thu, 9 Dec 1999, Chuck Silvers wrote:

> On Wed, Dec 08, 1999 at 11:32:52AM -0800, Bill Studenmund wrote:
> > 
> ok, so you're trying to detect the creation of dirty pages rather than
> prevent it.

Right. Though we're most interested in knowing if dirty pages have been
created rather than noting when they are created. Not sure if this nit
makes it easier. Something like a count of dirty pages would be fine.

> unfortunately there's not a really good answer for this now.  the best thing
> I can think of is to synchronously flush all pages before starting the archive
> and remember the mtime.  then when the archive is done, do the flush again
> and see if the mtime is different.  if so, then some pages were dirty and
> the archive copy is invalid. 

Actually, does the flushing use VOP_WRITE? If so, then things aren't too
bad. If the synchronous flush will call VOP_WRITE (which invalidates the
archiving), we just do that before we check to see if there were writes.

> the annoying thing here is that clean pages can become dirty immediately
> after you check for them, and what's worse is that the filesystem layer
> doesn't find out about this until somebody flushes the pages.  so if you
> allow VOP_READ()s to occur, those reads could be from the vm system
> creating a page cache page, which could immediately become dirty.

Our mark-it-archived call is in a VOP_FCNTL routine, so the vnode is
locked the whole time (this is ok for the flush routine, isn't it?). Thus
no one else will be able to map in pages & make them dirty until we're

Take care,