Re: 12x performance drop on md/linux+sw raid1 due to barriers [xfs]
From: Leon Woestenberg <hidden>
Date: 2008-12-22 13:19:02
Also in:
linux-xfs
Hello, On Sun, 21 Dec 2008 19:16:32 +0000, "Peter Grandi" [off-list ref] said:
quoted
The drive itself may still re-order writes, thus can cause corruption if halfway the power goes down. [ ... ] Barriers need to travel all the way down to the point where-after everything remains in-order. [ ... ] Whether the data has made it to the drive platters is not really important from a barrier point of view, however, iff part of the data made it to the platters, then we want to be sure it was in-order. [ ... ]But this discussion is backwards, as usual: the *purpose* of any kind of barriers cannot be just to guarantee consistency, but also stability, because ordered commits are not that useful without commit to stable storage.
I do not see in what sense you mean "stability"? Stable as in BIBO or non-volatile? Barriers are time-related. Once data is on storage, there is no relation with time. So I do not see how barriers help to "stabilize" storage. Ordered commits is a strong-enough condition to ensure consistency in the sense that atomic transactions either made it to the disk completely or not at all.
If barriers guarantee transaction stability, then consistency is also a consequence of serial dependencies among transactions (and as to that per-device barriers are a coarse and very underoptimal design).
Of course, the higher level should ensure that between transactions, the (meta)data is always consistent. In filesystem design, we see that some FS's decide to split metadata and data in this regard.
Anyhow, barriers for ordering only have been astutely patented quite recently: http://www.freshpatents.com/Transforming-flush-queue-command-to-memory-barrier-command-in-disk-drive-dt20070719ptan20070168626.php Amazing new from the patent office.y
Grand. Another case of no prior art. :-) Leon.