[dm-devel] Enabling/disabling BIO_RW_FAILFAST at load time

Kumar, Vijay (STSD) vijay.kumar7 at hp.com
Tue Sep 25 18:47:39 UTC 2007


Hi Christophe and All, 
During I/O on a path, the paths are marked as failed at DM Multipath,
when the I/O returns with Error status as 0x20000 (host code 0x2 denotes
DID_BUS_BUSY). What we understand here is, since I/O on multipath
devices have BIO_RW_FAILFAST set(hence REQ_FASTFAIL ), retries are not
allowed at SCSI mid layer for errors such as QUEUEFULL, UNDERRUN....(as
captured in the below syslog snippet)

syslog snippet
*******************
May 23 16:51:49 lnx kernel: sd 2:0:3:8: SCSI error: return code =
0x20000
May 23 16:51:49 lnx kernel: end_request: I/O error, dev sdfg, sector
4188002
May 23 16:51:49 lnx kernel: end_request: I/O error, dev sdfg, sector
4188008
May 23 16:51:49 lnx kernel: device-mapper: dm-multipath: Failing path
130:32.
May 23 16:51:49 lnx kernel: sd 2:0:3:8: SCSI error: return code =
0x20000
May 23 16:51:49 lnx kernel: end_request: I/O error, dev sdfg, sector
4188302
May 23 16:51:49 lnx kernel: end_request: I/O error, dev sdfg, sector
4188303
May 23 16:52:00 lnx kernel: sd 1:0:2:12: SCSI error: return code =
0x20000

As an option we can have user configurable BIO_RW_FAILFAST for enabling
and disabling which allows scsi mid layer to retry for I/0 .  Below is
the patch for passing parameter at load time with DM multipath module
for enabling/disabling BIO_RW_FAILFAST flag. 

* Flag can be set On/Off as follows

	modprobe dm-multipath fastfailbit=0		//seting it off
	modprobe dm-multipath fastfailbit=0		//seting it on

* By default the flag is kept on.

It can also be set from modprobe.conf as :

	options dm_multipath fastfailbit=0


Please comment !!

***************************************
diff -Naur linux-2.6.18.x86_64-orig/drivers/md/dm-mpath.c linux-
2.6.18.x86_64/drivers/md/dm-mpath.c
--- linux-2.6.18.x86_64-orig/drivers/md/dm-mpath.c      2007-08-27 
02:18:51.000000000 +0530
+++ linux-2.6.18.x86_64/drivers/md/dm-mpath.c   2007-09-12
16:02:29.000000000 
+0530
@@ -19,6 +19,7 @@
 #include <linux/slab.h>
 #include <linux/time.h>
 #include <linux/workqueue.h>
+#include <linux/moduleparam.h>
 #include <asm/atomic.h>

 #define DM_MSG_PREFIX "multipath"
@@ -107,6 +108,7 @@
 static void process_queued_ios(void *data);
 static void trigger_event(void *data);

+static int fastfailbit = 1;   /*fastfail bit set on by default*/

 /*-----------------------------------------------
  * Allocation routines
@@ -800,7 +802,7 @@
        dm_bio_record(&mpio->details, bio);

        map_context->ptr = mpio;
-       bio->bi_rw |= (1 << BIO_RW_FAILFAST);
+       bio->bi_rw |= (fastfailbit << BIO_RW_FAILFAST);
        r = map_io(m, bio, mpio, 0);
        if (r < 0 || r == DM_MAPIO_REQUEUE)
                mempool_free(mpio, m->mpio_pool);
@@ -1340,6 +1342,10 @@
 {
        int r;

+       /* validating fastfailbit */
+        if(fastfailbit)
+                fastfailbit=1;
+
        /* allocate a slab for the dm_ios */
        _mpio_cache = kmem_cache_create("dm_mpath", sizeof(struct
mpath_io),
                                        0, 0, NULL, NULL);
@@ -1387,6 +1393,8 @@
 module_init(dm_multipath_init);
 module_exit(dm_multipath_exit);

+module_param(fastfailbit, int, 0);
+MODULE_PARM_DESC(fastfailbit, "FASTFAIL bit flag ");
 MODULE_DESCRIPTION(DM_NAME " multipath target");
 MODULE_AUTHOR("Sistina Software <dm-devel at redhat.com>");
 MODULE_LICENSE("GPL");

******************************
 
> Thanks,
> 
> Vijay Kumar
> 
> [Kumar, Vijay (STSD)]
> mailto: vijay.kumar7 at hp.com
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/dm-devel/attachments/20070926/8e3daa33/attachment.htm>


More information about the dm-devel mailing list