Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Nov 2011 23:25:13 -0800
From:      Kirk McKusick <mckusick@mckusick.com>
To:        Kostik Belousov <kostikbel@gmail.com>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: Does UFS2 send BIO_FLUSH to GEOM when update metadata (with softupdates)? 
Message-ID:  <201111260725.pAQ7PDow056289@chez.mckusick.com>
In-Reply-To: <20111123194444.GE50300@deviant.kiev.zoral.com.ua> 

next in thread | previous in thread | raw e-mail | index | archive | help
Kostik,

You are entirely correct when you say that the requirement for
SU and SU+J is that it requires that notification of a disk-write
complete mean that the data is on the disk (stable). The problem
that arises is that (apparently) some tag-queue implementations
report back that tags have been written when in fact they have
not been written. 

I believe that they only way to ensure that a tagged request is
on stable store is to send a BIO_BARRIER request to the disk. The
BIO_BARRIER request is not supposed to return until all I/O
requests that were sent down prior to the BIO_BARRIER have been
committed to stable store.

If in fact the disk hardware lies about tag completion, my
proposed way for SU and SU+J to use BIO_BARRIER is to send
one down periodically (say every 100ms) and then defer processing
any I/O completions from before the barrier request until the
BIO_BARRIER completes. Since most SU activity is going on in
background, the delay should not be too noticable. The main
place where it would likely show up is in fsync which could be
delayed for up to the period (100ms). For such cases, the fsync
should issue its own BIO_BARRIER once it has initiated all of
its required I/O.

	Kirk McKusick



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201111260725.pAQ7PDow056289>