[zfs-discuss] Should I disable disk write cache ?
etienne at edechamps.fr
Thu Sep 3 05:35:11 EDT 2015
On 2 September 2015 at 11:17, Gordan Bobic via zfs-discuss <
zfs-discuss at list.zfsonlinux.org> wrote:
> One thing to be aware of however - I have looked at zfs-fuse code in some
> detail, and that includes code that explicitly issues disk flush commands
> to the underlying block device. Unfortunately, it doesn't distinguish
> between partitions and raw disks, so on some kernels it results in a flood
> of warnings from the kernel about issuing an ioctl to a partition, but this
> may be harmless.
> The important thing to note, however, is that the same code doesn't exist
> in ZoL, so if that is in fact issuing barriers, it is doing it some other
> way from some other place in the code.
In ZoL the DKIOCFLUSHWRITECACHE ioctl zio (which is issued from
zio_flush(), itself issued from places such as zil_flush_vdevs()) ends up
calling vdev_disk_io_flush(), which results in a
VDEV_WRITE_FLUSH_FUA BIO being issued to the Linux kernel disk I/O
subsystem. This is a write barrier operation, which (typically) makes the
Linux kernel trigger a full device queue flush followed by the appropriate
write cache flush command to the device. As far as I know there is nothing
wrong with these code paths and they provide the necessary guarantees as
long as the Linux drivers and the underlying hardware do what they're told.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the zfs-discuss