Subject: Re: UBC status
To: None <tech-kern@netbsd.org>
From: Thor Lancelot Simon <tls@rek.tjls.com>
List: tech-kern
Date: 09/27/1999 12:14:57
On Mon, Sep 27, 1999 at 08:45:20AM -0700, Matthew Jacob wrote:
> > 
> > > Solaris has a B_ORDERED flag which is a hint specifically for this type
> > > of thing.
> > > 
> > > Basically, metadata writes (and any other writes that need to be ordered)
> > > would set B_ORDERED, and this would affect disksort() (for disks which
> > > don't supported tagged commands) and the type of tag used (for disks that do).
> > > 
> > > A B_URGENT (Head-Of-Queue tag) flag might also be useful.
> > 
> > I don't believe that any queue types other than simple queue are used,
> > primarily due to buggy implementations of other tag types in target
> > devices.  You must be thinking of some other OS.
> 
> Solaris uses FLAG_STAG, yes. Kleiman originally wanted B_ORDERED to be
> propagated to the driver so that a FLAG_OTAG would then be used to force
> all the previous STAG operations out. I guess this didn't get followed up
> on.

What is the point of having a B_ORDERED flag if the target device is,
ultimately, allowed not to treat it as a barrier?

Certainly, to get the FFS metadata semantics right, AFAICT, you really
want to use an ordered tag to force all the previous I/O you've issued to 
the disks to complete.  This is why we currently use ordered tags for
*all* writes in at least some drivers (any that don't should!).  At least
one Linux device driver I've looked at closely does what Jason's proposing:
use ordered tags as barriers to force simple tags to complete.  How can
Solaris preserve FFS metadata consistency guarantees if it writes using
simple tags?