From e6603b7c1fc7ac01f8891b11df34d943812153e9 Mon Sep 17 00:00:00 2001 From: Tim Chase Date: Fri, 8 Jul 2016 10:33:01 -0500 Subject: Fix sync behavior for disk vdevs Prior to b39c22b, which was first generally available in the 0.6.5 release as b39c22b, ZoL never actually submitted synchronous read or write requests to the Linux block layer. This means the vdev_disk_dio_is_sync() function had always returned false and, therefore, the completion in dio_request_t.dr_comp was never actually used. In b39c22b, synchronous ZIO operations were translated to synchronous BIO requests in vdev_disk_io_start(). The follow-on commits 5592404 and aa159af fixed several problems introduced by b39c22b. In particular, 5592404 introduced the new flag parameter "wait" to __vdev_disk_physio() but under ZoL, since vdev_disk_physio() is never actually used, the wait flag was always zero so the new code had no effect other than to cause a bug in the use of the dio_request_t.dr_comp which was fixed by aa159af. The original rationale for introducing synchronous operations in b39c22b was to hurry certains requests through the BIO layer which would have otherwise been subject to its unplug timer which would increase the latency. This behavior of the unplug timer, however, went away during the transition of the plug/unplug system between kernels 2.6.32 and 2.6.39. To handle the unplug timer behavior on 2.6.32-2.6.35 kernels the BIO_RW_UNPLUG flag is used as a hint to suppress the plugging behavior. For kernels 2.6.36-2.6.38, the REQ_UNPLUG macro will be available and ise used for the same purpose. Signed-off-by: Tim Chase Signed-off-by: Brian Behlendorf Closes #4858 --- include/sys/vdev_disk.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/sys') diff --git a/include/sys/vdev_disk.h b/include/sys/vdev_disk.h index d5a1889d2..c6d5f92b2 100644 --- a/include/sys/vdev_disk.h +++ b/include/sys/vdev_disk.h @@ -37,9 +37,11 @@ typedef struct vdev_disk { struct block_device *vd_bdev; } vdev_disk_t; +#ifndef __linux__ extern int vdev_disk_physio(struct block_device *, caddr_t, size_t, uint64_t, int); extern int vdev_disk_read_rootlabel(char *, char *, nvlist_t **); +#endif #endif /* _KERNEL */ #endif /* _SYS_VDEV_DISK_H */ -- cgit v1.2.3