All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: dm-devel@redhat.com, snitzer@redhat.com
Cc: Tejun Heo <tj@kernel.org>
Subject: [PATCH 5/6] dm: use non-reentrant workqueues if equivalent
Date: Sun, 12 Dec 2010 20:10:54 +0100	[thread overview]
Message-ID: <1292181055-25696-6-git-send-email-tj@kernel.org> (raw)
In-Reply-To: <1292181055-25696-1-git-send-email-tj@kernel.org>

kmirrord_wq, kcopyd_work and md->wq are created per dm instance and
serves only 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>
Cc: Mike Snitzer <snitzer@redhat.com>
Cc: dm-devel@redhat.com
---
 drivers/md/dm-kcopyd.c |    3 ++-
 drivers/md/dm-raid1.c  |    3 ++-
 drivers/md/dm.c        |    3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/md/dm-kcopyd.c b/drivers/md/dm-kcopyd.c
index 6d641e8..20c1a11 100644
--- a/drivers/md/dm-kcopyd.c
+++ b/drivers/md/dm-kcopyd.c
@@ -624,7 +624,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;
 
diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c
index 5139091..32bc404 100644
--- a/drivers/md/dm-raid1.c
+++ b/drivers/md/dm-raid1.c
@@ -1077,7 +1077,8 @@ static int mirror_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 	ti->split_io = dm_rh_get_region_size(ms->rh);
 	ti->num_flush_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;
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 064b2dc..854409d 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -1884,7 +1884,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;
 
-- 
1.7.1

  parent reply	other threads:[~2010-12-12 19:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-12 19:10 [PATCHSET] dm: update workqueue usages Tejun Heo
2010-12-12 19:10 ` [PATCH 1/6] dm-stripe: drop kstriped Tejun Heo
2010-12-14 23:59   ` Mike Snitzer
2010-12-15  1:34     ` Mike Snitzer
2011-01-07 23:02       ` Alasdair G Kergon
2011-01-08 17:16         ` Tejun Heo
2010-12-12 19:10 ` [PATCH 2/6] dm-snap: kill unused dm_snapshot->queued_bios_work and ksnapd Tejun Heo
2010-12-12 19:10 ` [PATCH 3/6] dm-snap: convert to alloc[_ordered]_workqueue() Tejun Heo
2010-12-12 19:10 ` [PATCH 4/6] dm: don't use flush_scheduled_work() Tejun Heo
2010-12-12 19:10 ` Tejun Heo [this message]
2010-12-12 19:10 ` [PATCH 6/6] dm-snap-persistent: make metadata_wq multithreaded Tejun Heo
2011-01-08  3:31   ` Mikulas Patocka
2010-12-12 21:23 ` [PATCHSET] dm: update workqueue usages Milan Broz
2010-12-14 15:49   ` Tejun Heo
2010-12-14 16:03     ` Mike Snitzer
2010-12-14 16:05       ` Tejun Heo
2010-12-20 14:14         ` Mike Snitzer
2010-12-20 16:03           ` Tejun Heo
2010-12-14 12:19 ` [PATCHSET] " Heinz Mauelshagen
2010-12-14 13:16   ` Tejun Heo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1292181055-25696-6-git-send-email-tj@kernel.org \
    --to=tj@kernel.org \
    --cc=dm-devel@redhat.com \
    --cc=snitzer@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.