[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[dm-devel] [PATCH RFC 5/5] add support for manual failover devices



05-mpath-wq.patch - dispatch_failed_ios can sleep. It should not
disrupt other users of the default work queue. Under heavy load
or group initializations on a single processor machine, this
problem becomes painful.

 dm-mpath.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletion(-)
--- linux-2.6.5-rc1-udm1-orig/drivers/md/dm-mpath.c	2004-04-06 02:43:34.542690998 -0700
+++ linux-2.6.5-rc1-udm1-work/drivers/md/dm-mpath.c	2004-04-06 02:41:38.717656022 -0700
@@ -285,6 +285,8 @@ static int map_io(struct multipath *m, s
 /*-----------------------------------------------------------------
  * The multipath daemon is responsible for resubmitting failed ios.
  *---------------------------------------------------------------*/
+struct workqueue_struct *kmultipathd;
+
 static void dispatch_failed_ios(void *data)
 {
 	struct multipath *m = (struct multipath *) data;
@@ -592,7 +594,7 @@ static int do_end_io(struct multipath *m
 		bio_list_add(&m->failed_ios, bio);
 		spin_unlock(&m->lock);
 
-		schedule_work(&m->dispatch_failed);
+		queue_work(kmultipathd, &m->dispatch_failed);
 		return 1;	/* io not complete */
 	}
 
@@ -707,6 +709,13 @@ int __init dm_multipath_init(void)
 		return r;
 	}
 
+	kmultipathd = create_workqueue("kmpathd");
+	if (!kmultipathd) {
+		dm_unregister_path_selectors();
+		dm_unregister_target(&multipath_target);
+		kmem_cache_destroy(_details_cache);
+	}
+
 	DMINFO("dm_multipath v0.2.0");
 	return r;
 }
@@ -715,6 +724,7 @@ void __exit dm_multipath_exit(void)
 {
 	int r;
 
+	destroy_workqueue(kmultipathd);
 	dm_unregister_path_selectors();
 	r = dm_unregister_target(&multipath_target);
 	if (r < 0)

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]