]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
dm mpath: remove repeat_count support from multipath core
authorMike Snitzer <snitzer@redhat.com>
Wed, 10 Feb 2016 16:58:45 +0000 (11:58 -0500)
committerMike Snitzer <snitzer@redhat.com>
Tue, 23 Feb 2016 03:34:40 +0000 (22:34 -0500)
Preparation for making __multipath_map() avoid taking the m->lock
spinlock -- in favor of using RCU locking.

repeat_count was primarily for bio-based DM multipath's benefit.  There
is really no need for it anymore now that DM multipath is request-based.
As such, repeat_count > 1 is no longer honored and a warning is
displayed if the user attempts to use a value > 1.  This is a temporary
change for the round-robin path-selector (as a later commit will restore
its support for repeat_count > 1).

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-mpath.c
drivers/md/dm-queue-length.c
drivers/md/dm-round-robin.c
drivers/md/dm-service-time.c

index cfe55910699d91fa1fbf124dee8ec432adcc0d09..0c32b2b7856cccff50a86242e9a3de2d2b8c63f3 100644 (file)
@@ -83,7 +83,6 @@ struct multipath {
        struct pgpath *current_pgpath;
        struct priority_group *current_pg;
        struct priority_group *next_pg; /* Switch to this PG if set */
-       unsigned repeat_count;          /* I/Os left before calling PS again */
 
        unsigned queue_io:1;            /* Must we queue all I/O? */
        unsigned queue_if_no_path:1;    /* Queue I/O if last path fails? */
@@ -319,8 +318,9 @@ static int __choose_path_in_pg(struct multipath *m, struct priority_group *pg,
                               size_t nr_bytes)
 {
        struct dm_path *path;
+       unsigned repeat_count;
 
-       path = pg->ps.type->select_path(&pg->ps, &m->repeat_count, nr_bytes);
+       path = pg->ps.type->select_path(&pg->ps, &repeat_count, nr_bytes);
        if (!path)
                return -ENXIO;
 
@@ -412,8 +412,7 @@ static int __multipath_map(struct dm_target *ti, struct request *clone,
        spin_lock_irq(&m->lock);
 
        /* Do we need to select a new pgpath? */
-       if (!m->current_pgpath ||
-           (!m->queue_io && (m->repeat_count && --m->repeat_count == 0)))
+       if (!m->current_pgpath || !m->queue_io)
                __choose_pgpath(m, nr_bytes);
 
        pgpath = m->current_pgpath;
index 3941fae0de9fd79f875f5ea32ce14b03cb76d8aa..51d82290ad4c6d25ef2c52d599e3f88f6c96e934 100644 (file)
@@ -23,8 +23,8 @@
 #include <linux/atomic.h>
 
 #define DM_MSG_PREFIX  "multipath queue-length"
-#define QL_MIN_IO      128
-#define QL_VERSION     "0.1.0"
+#define QL_MIN_IO      1
+#define QL_VERSION     "0.2.0"
 
 struct selector {
        struct list_head        valid_paths;
@@ -129,6 +129,11 @@ static int ql_add_path(struct path_selector *ps, struct dm_path *path,
                return -EINVAL;
        }
 
+       if (repeat_count > 1) {
+               DMWARN_LIMIT("repeat_count > 1 is deprecated, using 1 instead");
+               repeat_count = 1;
+       }
+
        /* Allocate the path information structure */
        pi = kmalloc(sizeof(*pi), GFP_KERNEL);
        if (!pi) {
index 6ab1192cdd5fcf766f67b76ff7a6678db4fab8a7..65ffdc3403b6ce963eb89b6cf3fe09aeb88d734f 100644 (file)
@@ -17,6 +17,8 @@
 #include <linux/module.h>
 
 #define DM_MSG_PREFIX "multipath round-robin"
+#define RR_MIN_IO     1
+#define RR_VERSION    "1.1.0"
 
 /*-----------------------------------------------------------------
  * Path-handling code, paths are held in lists
@@ -41,8 +43,6 @@ static void free_paths(struct list_head *paths)
  * Round-robin selector
  *---------------------------------------------------------------*/
 
-#define RR_MIN_IO              1000
-
 struct selector {
        struct list_head valid_paths;
        struct list_head invalid_paths;
@@ -127,6 +127,11 @@ static int rr_add_path(struct path_selector *ps, struct dm_path *path,
                return -EINVAL;
        }
 
+       if (repeat_count > 1) {
+               DMWARN_LIMIT("repeat_count > 1 is deprecated, using 1 instead");
+               repeat_count = 1;
+       }
+
        /* allocate the path */
        pi = kmalloc(sizeof(*pi), GFP_KERNEL);
        if (!pi) {
@@ -198,7 +203,7 @@ static int __init dm_rr_init(void)
        if (r < 0)
                DMERR("register failed %d", r);
 
-       DMINFO("version 1.0.0 loaded");
+       DMINFO("version " RR_VERSION " loaded");
 
        return r;
 }
index 9df8f6bd64181fd9d4b1f1eb425d247b501fcb66..0370eaf3d94910959b71495f2e4e0796bf58792c 100644 (file)
@@ -19,7 +19,7 @@
 #define ST_MAX_RELATIVE_THROUGHPUT     100
 #define ST_MAX_RELATIVE_THROUGHPUT_SHIFT       7
 #define ST_MAX_INFLIGHT_SIZE   ((size_t)-1 >> ST_MAX_RELATIVE_THROUGHPUT_SHIFT)
-#define ST_VERSION     "0.2.0"
+#define ST_VERSION     "0.3.0"
 
 struct selector {
        struct list_head valid_paths;
@@ -134,6 +134,11 @@ static int st_add_path(struct path_selector *ps, struct dm_path *path,
                return -EINVAL;
        }
 
+       if (repeat_count > 1) {
+               DMWARN_LIMIT("repeat_count > 1 is deprecated, using 1 instead");
+               repeat_count = 1;
+       }
+
        if ((argc == 2) &&
            (sscanf(argv[1], "%u%c", &relative_throughput, &dummy) != 1 ||
             relative_throughput > ST_MAX_RELATIVE_THROUGHPUT)) {