dm: use non reentrant workqueues if equivalent
authorTejun Heo <tj@kernel.org>
Thu, 13 Jan 2011 19:59:58 +0000 (19:59 +0000)
committerAlasdair G Kergon <agk@redhat.com>
Thu, 13 Jan 2011 19:59:58 +0000 (19:59 +0000)
kmirrord_wq, kcopyd_work and md->wq are created per dm instance and
serve only a single work item from the dm instance, so non-reentrant
workqueues would provide the same ordering guarantees as ordered ones
while allowing CPU affinity and use of the workqueues for other
purposes.  Switch them to non-reentrant workqueues.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
drivers/md/dm-kcopyd.c
drivers/md/dm-raid1.c
drivers/md/dm.c
include/linux/dm-ioctl.h

index 63d67169c7f4913c533a65ceafe57df3d8bbdada..924f5f0084c27191604907eaa9983a2bf687b6c1 100644 (file)
@@ -672,7 +672,8 @@ int dm_kcopyd_client_create(unsigned int nr_pages,
                goto bad_slab;
 
        INIT_WORK(&kc->kcopyd_work, do_work);
-       kc->kcopyd_wq = alloc_ordered_workqueue("kcopyd", WQ_MEM_RECLAIM);
+       kc->kcopyd_wq = alloc_workqueue("kcopyd",
+                                       WQ_NON_REENTRANT | WQ_MEM_RECLAIM, 0);
        if (!kc->kcopyd_wq)
                goto bad_workqueue;
 
index 39917430f9f8a2610ee2a8ddfae6439b2ae3ecdd..dee326775c6064b045c8cf523a25a528d9882caf 100644 (file)
@@ -1085,7 +1085,8 @@ static int mirror_ctr(struct dm_target *ti, unsigned int argc, char **argv)
        ti->num_flush_requests = 1;
        ti->num_discard_requests = 1;
 
-       ms->kmirrord_wq = alloc_ordered_workqueue("kmirrord", WQ_MEM_RECLAIM);
+       ms->kmirrord_wq = alloc_workqueue("kmirrord",
+                                         WQ_NON_REENTRANT | WQ_MEM_RECLAIM, 0);
        if (!ms->kmirrord_wq) {
                DMERR("couldn't start kmirrord");
                r = -ENOMEM;
@@ -1414,7 +1415,7 @@ static int mirror_iterate_devices(struct dm_target *ti,
 
 static struct target_type mirror_target = {
        .name    = "mirror",
-       .version = {1, 12, 0},
+       .version = {1, 12, 1},
        .module  = THIS_MODULE,
        .ctr     = mirror_ctr,
        .dtr     = mirror_dtr,
index 39aaa9290128864f5ba91c9acb6e72ce170bb0f1..e504bb40d60ecf9efaf55d5411375fdf989aca91 100644 (file)
@@ -1883,7 +1883,8 @@ static struct mapped_device *alloc_dev(int minor)
        add_disk(md->disk);
        format_dev_t(md->name, MKDEV(_major, minor));
 
-       md->wq = alloc_ordered_workqueue("kdmflush", WQ_MEM_RECLAIM);
+       md->wq = alloc_workqueue("kdmflush",
+                                WQ_NON_REENTRANT | WQ_MEM_RECLAIM, 0);
        if (!md->wq)
                goto bad_thread;
 
index e453e1174ae181501ed38a26265e57861fac28e8..78bbf47bbb96523076dfe1f933323361f7eeda32 100644 (file)
@@ -268,8 +268,8 @@ enum {
 
 #define DM_VERSION_MAJOR       4
 #define DM_VERSION_MINOR       19
-#define DM_VERSION_PATCHLEVEL  0
-#define DM_VERSION_EXTRA       "-ioctl (2010-10-14)"
+#define DM_VERSION_PATCHLEVEL  1
+#define DM_VERSION_EXTRA       "-ioctl (2011-01-07)"
 
 /* Status bits */
 #define DM_READONLY_FLAG       (1 << 0) /* In/Out */