Does UFS2 send BIO_FLUSH to GEOM when update metadata (with softupdates)?

Lev Serebryakov lev at FreeBSD.org
Sat Nov 26 07:37:52 UTC 2011


Hello, Pawel.
You wrote 25 ноября 2011 г., 19:16:47:

> Because synchronous writes are hard to count on these days, you need to
> ensure the ordering is right by either using BIO_FLUSH or some
> (nonexistent) BIO_BARRIER.
  Here IS BIO_ORDERED. And disksort() function respect it. Drivers are
 not. But I more like adding BIO_FSYNC flag, which will means
 "Ordered, and, pleas try be as synchronious as possible". :)

  Now I have VM running to calculate number of bwrite()'s from
 softupdate code vs "simple" bwrite()s, by adding flag to "struct buf"
 for EACH softupdate bwrite(). But here is a problem, see below.

> Synchronous writes (or BIO_FLUSH) are needed to handle O_SYNC/fsync(2)
> properly, which UFS currently doesn't care about.
   Yep, and this too. But I'm not sure, that I could identify all
 codepaths in FFS/UFS/SoftUpdates/SU+J which starts in (a) SU updates
 and (b) O_SYNC wtires (c) fsync() calls. And adding THE SAME flag for
 all cases is slightly too much (see above), as O_SYNC and fsync()
 needs true sync, and SU needs only ordering flag.

   It is possible to add all these into GEOM, and ATA/AHCI author
 (Alexander Motin) is ready to add support for them to ATA/AHCI, but,
 again, I need help from UFS/FFS/SU guru to add all needed and only
 needed flags in each and every proper place.

-- 
// Black Lion AKA Lev Serebryakov <lev at FreeBSD.org>



More information about the freebsd-fs mailing list