Date: Sat, 26 Nov 2011 11:37:44 +0400 From: Lev Serebryakov <lev@FreeBSD.org> To: Pawel Jakub Dawidek <pjd@FreeBSD.org> Cc: freebsd-fs@freebsd.org Subject: Re: Does UFS2 send BIO_FLUSH to GEOM when update metadata (with softupdates)? Message-ID: <1355750307.20111126113744@serebryakov.spb.ru> In-Reply-To: <20111125151646.GC1642@garage.freebsd.pl> References: <1957615267.20111123230026@serebryakov.spb.ru> <20111123194444.GE50300@deviant.kiev.zoral.com.ua> <20111125110235.GB1642@garage.freebsd.pl> <20111125113756.GZ50300@deviant.kiev.zoral.com.ua> <20111125151646.GC1642@garage.freebsd.pl>
next in thread | previous in thread | raw e-mail | index | archive | help
Hello, Pawel. You wrote 25 =ED=EE=FF=E1=F0=FF 2011 =E3., 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. --=20 // Black Lion AKA Lev Serebryakov <lev@FreeBSD.org>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1355750307.20111126113744>