Subject: Re: Rewrite of buffer queue interface
To: None <tech-kern@netbsd.org>
From: David Laight <david@l8s.co.uk>
List: tech-kern
Date: 07/13/2002 17:57:59
> > - Writes to be scheduled that must happed after a previous one.
> >   Eg updating file system metadata in a guaranteed order.
> 
> This is a job for the (up to now unused) B_ORDERED flag. Guarantee
> that all write requests are complete before this one gets processed.
> This code (the 'synchronisation' markers) is already present.
> I assume it to be sufficient if these markers are only valid for
> write-requests.

No - that does something (horribly) different - since it tends destroy
any possible optimistations.
I was thinking of something that would ensure (say) that an inode
update (to delete a file) before the allocation map bits are
changed.
Maybe the second write could just be scheduled when the first finishes
from the biodone() code.
> 
> > - Reclaiming structures from the write queue (can this be done now?)
> >   While still maintaining the ordering relation above.
> 
> I can't see a reason why a request should be taken out of the queue.

Because the buffer is needed again!
This could very easily happen for inodes (128 bytes?) when lots
of adjacent inodes are updated quickly.

Or is the kernel allowed to modify buffers that are queued for write?
That could easily lead to nastily corrupt disk blocks.

	David

-- 
David Laight: david@l8s.co.uk