summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2010-10-01 10:57:56 -0700
committerBrian Behlendorf <[email protected]>2010-10-12 14:55:02 -0700
commit2959d94a0a53612cc1ca9ce9d17df26c3d69a513 (patch)
treef4571ef38043563b698daa65e0db62e69de46868 /config
parentc5343ba71b9fea6e3636be25a16173092f2042ba (diff)
Add FAILFAST support
ZFS works best when it is notified as soon as possible when a device failure occurs. This allows it to immediately start any recovery actions which may be needed. In theory Linux supports a flag which can be set on bio's called FAILFAST which provides this quick notification by disabling the retry logic in the lower scsi layers. That's the theory at least. In practice is turns out that while the flag exists you oddly have to set it with the BIO_RW_AHEAD flag. And even when it's set it you may get retries in the low level drivers decides that's the right behavior, or if you don't get the right error codes reported to the scsi midlayer. Unfortunately, without additional kernels patchs there's not much which can be done to improve this. Basically, this just means that it may take 2-3 minutes before a ZFS is notified properly that a device has failed. This can be improved and I suspect I'll be submitting patches upstream to handle this.
Diffstat (limited to 'config')
-rw-r--r--config/kernel-bio-failfast.m422
-rw-r--r--config/kernel.m41
2 files changed, 23 insertions, 0 deletions
diff --git a/config/kernel-bio-failfast.m4 b/config/kernel-bio-failfast.m4
new file mode 100644
index 000000000..acc657562
--- /dev/null
+++ b/config/kernel-bio-failfast.m4
@@ -0,0 +1,22 @@
+dnl #
+dnl # 2.6.28 API change
+dnl # Device, transport, and driver FAILFAST flags were added and
+dnl # the now legacy BIO_RW_FAILFAST flag was removed.
+dnl #
+AC_DEFUN([ZFS_AC_KERNEL_BIO_FAILFAST], [
+ AC_MSG_CHECKING([whether BIO_RW_FAILFAST_* are defined])
+ ZFS_LINUX_TRY_COMPILE([
+ #include <linux/bio.h>
+ ],[
+ int flags;
+ flags = ((1 << BIO_RW_FAILFAST_DEV) |
+ (1 << BIO_RW_FAILFAST_TRANSPORT) |
+ (1 << BIO_RW_FAILFAST_DRIVER));
+ ],[
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_BIO_RW_FAILFAST, 1,
+ [BIO_RW_FAILFAST_* are defined])
+ ],[
+ AC_MSG_RESULT(no)
+ ])
+])
diff --git a/config/kernel.m4 b/config/kernel.m4
index 193aae113..517af39f7 100644
--- a/config/kernel.m4
+++ b/config/kernel.m4
@@ -12,6 +12,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
ZFS_AC_KERNEL_INVALIDATE_BDEV_ARGS
ZFS_AC_KERNEL_BDEV_LOGICAL_BLOCK_SIZE
ZFS_AC_KERNEL_BIO_EMPTY_BARRIER
+ ZFS_AC_KERNEL_BIO_FAILFAST
ZFS_AC_KERNEL_BIO_END_IO_T_ARGS
ZFS_AC_KERNEL_BIO_RW_SYNCIO
ZFS_AC_KERNEL_BLK_END_REQUEST