diff options
author | Tejun Heo <tj@kernel.org> | 2011-01-13 14:59:58 -0500 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2011-01-13 14:59:58 -0500 |
commit | 9c4376de98719d2768dd919553843de34bb094a6 (patch) | |
tree | c20b10e9018bb51803c535a38a04ee8b12b6d98a /drivers/md | |
parent | 4d4d66ab5322fa9b0f51842a76139387a40e1ce9 (diff) |
dm: use non reentrant workqueues if equivalent
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>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/dm-kcopyd.c | 3 | ||||
-rw-r--r-- | drivers/md/dm-raid1.c | 5 | ||||
-rw-r--r-- | drivers/md/dm.c | 3 |
3 files changed, 7 insertions, 4 deletions
diff --git a/drivers/md/dm-kcopyd.c b/drivers/md/dm-kcopyd.c index 63d67169c7f4..924f5f0084c2 100644 --- a/drivers/md/dm-kcopyd.c +++ b/drivers/md/dm-kcopyd.c | |||
@@ -672,7 +672,8 @@ int dm_kcopyd_client_create(unsigned int nr_pages, | |||
672 | goto bad_slab; | 672 | goto bad_slab; |
673 | 673 | ||
674 | INIT_WORK(&kc->kcopyd_work, do_work); | 674 | INIT_WORK(&kc->kcopyd_work, do_work); |
675 | kc->kcopyd_wq = alloc_ordered_workqueue("kcopyd", WQ_MEM_RECLAIM); | 675 | kc->kcopyd_wq = alloc_workqueue("kcopyd", |
676 | WQ_NON_REENTRANT | WQ_MEM_RECLAIM, 0); | ||
676 | if (!kc->kcopyd_wq) | 677 | if (!kc->kcopyd_wq) |
677 | goto bad_workqueue; | 678 | goto bad_workqueue; |
678 | 679 | ||
diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c index 39917430f9f8..dee326775c60 100644 --- a/drivers/md/dm-raid1.c +++ b/drivers/md/dm-raid1.c | |||
@@ -1085,7 +1085,8 @@ static int mirror_ctr(struct dm_target *ti, unsigned int argc, char **argv) | |||
1085 | ti->num_flush_requests = 1; | 1085 | ti->num_flush_requests = 1; |
1086 | ti->num_discard_requests = 1; | 1086 | ti->num_discard_requests = 1; |
1087 | 1087 | ||
1088 | ms->kmirrord_wq = alloc_ordered_workqueue("kmirrord", WQ_MEM_RECLAIM); | 1088 | ms->kmirrord_wq = alloc_workqueue("kmirrord", |
1089 | WQ_NON_REENTRANT | WQ_MEM_RECLAIM, 0); | ||
1089 | if (!ms->kmirrord_wq) { | 1090 | if (!ms->kmirrord_wq) { |
1090 | DMERR("couldn't start kmirrord"); | 1091 | DMERR("couldn't start kmirrord"); |
1091 | r = -ENOMEM; | 1092 | r = -ENOMEM; |
@@ -1414,7 +1415,7 @@ static int mirror_iterate_devices(struct dm_target *ti, | |||
1414 | 1415 | ||
1415 | static struct target_type mirror_target = { | 1416 | static struct target_type mirror_target = { |
1416 | .name = "mirror", | 1417 | .name = "mirror", |
1417 | .version = {1, 12, 0}, | 1418 | .version = {1, 12, 1}, |
1418 | .module = THIS_MODULE, | 1419 | .module = THIS_MODULE, |
1419 | .ctr = mirror_ctr, | 1420 | .ctr = mirror_ctr, |
1420 | .dtr = mirror_dtr, | 1421 | .dtr = mirror_dtr, |
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 39aaa9290128..e504bb40d60e 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c | |||
@@ -1883,7 +1883,8 @@ static struct mapped_device *alloc_dev(int minor) | |||
1883 | add_disk(md->disk); | 1883 | add_disk(md->disk); |
1884 | format_dev_t(md->name, MKDEV(_major, minor)); | 1884 | format_dev_t(md->name, MKDEV(_major, minor)); |
1885 | 1885 | ||
1886 | md->wq = alloc_ordered_workqueue("kdmflush", WQ_MEM_RECLAIM); | 1886 | md->wq = alloc_workqueue("kdmflush", |
1887 | WQ_NON_REENTRANT | WQ_MEM_RECLAIM, 0); | ||
1887 | if (!md->wq) | 1888 | if (!md->wq) |
1888 | goto bad_thread; | 1889 | goto bad_thread; |
1889 | 1890 | ||