From: Tejun Heo <tj@kernel.org>
To: dm-devel@redhat.com, snitzer@redhat.com
Cc: Tejun Heo <tj@kernel.org>
Subject: [PATCH 1/6] dm-stripe: drop kstriped
Date: Sun, 12 Dec 2010 20:10:50 +0100 [thread overview]
Message-ID: <1292181055-25696-2-git-send-email-tj@kernel.org> (raw)
In-Reply-To: <1292181055-25696-1-git-send-email-tj@kernel.org>
kstriped only serves sc->kstriped_ws which runs dm_table_event().
This doesn't need to be executed from an ordered workqueue w/ rescuer.
Drop kstriped and use the system_wq instead. While at it, rename
kstriped_ws to trigger_event so that it's consistent with other dm
modules.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Mike Snitzer <snitzer@redhat.com>
Cc: dm-devel@redhat.com
---
drivers/md/dm-stripe.c | 25 ++++++-------------------
1 files changed, 6 insertions(+), 19 deletions(-)
diff --git a/drivers/md/dm-stripe.c b/drivers/md/dm-stripe.c
index f0371b4..f756ac1 100644
--- a/drivers/md/dm-stripe.c
+++ b/drivers/md/dm-stripe.c
@@ -39,23 +39,20 @@ struct stripe_c {
struct dm_target *ti;
/* Work struct used for triggering events*/
- struct work_struct kstriped_ws;
+ struct work_struct trigger_event;
struct stripe stripe[0];
};
-static struct workqueue_struct *kstriped;
-
/*
* An event is triggered whenever a drive
* drops out of a stripe volume.
*/
static void trigger_event(struct work_struct *work)
{
- struct stripe_c *sc = container_of(work, struct stripe_c, kstriped_ws);
-
+ struct stripe_c *sc = container_of(work, struct stripe_c,
+ trigger_event);
dm_table_event(sc->ti->table);
-
}
static inline struct stripe_c *alloc_context(unsigned int stripes)
@@ -160,7 +157,7 @@ static int stripe_ctr(struct dm_target *ti, unsigned int argc, char **argv)
return -ENOMEM;
}
- INIT_WORK(&sc->kstriped_ws, trigger_event);
+ INIT_WORK(&sc->trigger_event, trigger_event);
/* Set pointer to dm target; used in trigger_event */
sc->ti = ti;
@@ -211,7 +208,7 @@ static void stripe_dtr(struct dm_target *ti)
for (i = 0; i < sc->stripes; i++)
dm_put_device(ti, sc->stripe[i].dev);
- flush_workqueue(kstriped);
+ flush_scheduled_work();
kfree(sc);
}
@@ -367,7 +364,7 @@ static int stripe_end_io(struct dm_target *ti, struct bio *bio,
atomic_inc(&(sc->stripe[i].error_count));
if (atomic_read(&(sc->stripe[i].error_count)) <
DM_IO_ERROR_THRESHOLD)
- queue_work(kstriped, &sc->kstriped_ws);
+ schedule_work(&sc->trigger_event);
}
return error;
@@ -422,20 +419,10 @@ int __init dm_stripe_init(void)
return r;
}
- kstriped = create_singlethread_workqueue("kstriped");
- if (!kstriped) {
- DMERR("failed to create workqueue kstriped");
- dm_unregister_target(&stripe_target);
- return -ENOMEM;
- }
-
return r;
}
void dm_stripe_exit(void)
{
dm_unregister_target(&stripe_target);
- destroy_workqueue(kstriped);
-
- return;
}
--
1.7.1
next prev 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 ` Tejun Heo [this message]
2010-12-14 23:59 ` [PATCH 1/6] dm-stripe: drop kstriped 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 ` [PATCH 5/6] dm: use non-reentrant workqueues if equivalent Tejun Heo
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-2-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.