Re: [PATCH] queue barrier support

From: James Bottomley (James.Bottomley@SteelEye.com)
Date: Fri Feb 15 2002 - 11:51:45 EST


mason@suse.com said:
> While I've got linux-scsi cc'd, I'll reask a question from yesterday.
> Do the targets with write back caches usually ignore the order tag,
> doing the write in the most efficient way possible instead?

I'll try to answer, although I'm not quite sure of the basis of the question.

No ordinary SCSI drive that's not on a battery backed circuit should *ever*
use writeback caching. They should all come by default as write through. In
this case, the tag is acknowleged as completed only when the write has made it
to the medium.

If you alter the drive parameter page to turn on write back caching, it's
caveat emptor. Since you're now telling the drive that you consider hitting
the cache to be equivalent to hitting the medium (because you know better
about power failures and the like) it is undefined by the standards how the
drives write from the cache to the medium---and you shouldn't care about this
if you have arranged your system to do write back caching. They will
acknowlege the tag as completed as soon as it hits the cache, and the ordered
tag will be order it commits to the cache.

Note, for high end disk arrays, the reverse is usually true since they often
have internal battery backups for their caches and drives.

If you lose power to the drive that does write back caching before the cache
flushes, all the indications you've given the journalling fs about write
commits are voided and the fs is probably inconsistent and not recoverable by
a journal replay.

Note also that on system shutdown, most devices that use write back caching
are also expecting a cache flush instruction from the node, which Linux
doesn't send.

James

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Feb 15 2002 - 21:01:08 EST