diff options
author | Tejun Heo <tj@kernel.org> | 2011-01-13 14:59:59 -0500 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2011-01-13 14:59:59 -0500 |
commit | 239c8dd533e74de4a7f3c85c4f9f430eb08867c1 (patch) | |
tree | 0dfb9e39aad0f2ab09a4f278a6e7f1b46bf64307 /drivers/md/dm-snap-persistent.c | |
parent | 9c4376de98719d2768dd919553843de34bb094a6 (diff) |
dm snapshot: persistent make metadata_wq multithreaded
metadata_wq serves on-stack work items from chunk_io(). Even if
multiple chunk_io() are simultaneously in progress, each is
independent and queued only once, so multithreaded workqueue can be
safely used.
Switch metadata_wq to multithread and flush the work item instead of
the workqueue in chunk_io().
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/dm-snap-persistent.c')
-rw-r--r-- | drivers/md/dm-snap-persistent.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/dm-snap-persistent.c b/drivers/md/dm-snap-persistent.c index d3021a69c857..95891dfcbca0 100644 --- a/drivers/md/dm-snap-persistent.c +++ b/drivers/md/dm-snap-persistent.c | |||
@@ -256,7 +256,7 @@ static int chunk_io(struct pstore *ps, void *area, chunk_t chunk, int rw, | |||
256 | */ | 256 | */ |
257 | INIT_WORK_ONSTACK(&req.work, do_metadata); | 257 | INIT_WORK_ONSTACK(&req.work, do_metadata); |
258 | queue_work(ps->metadata_wq, &req.work); | 258 | queue_work(ps->metadata_wq, &req.work); |
259 | flush_workqueue(ps->metadata_wq); | 259 | flush_work(&req.work); |
260 | 260 | ||
261 | return req.result; | 261 | return req.result; |
262 | } | 262 | } |
@@ -818,7 +818,7 @@ static int persistent_ctr(struct dm_exception_store *store, | |||
818 | atomic_set(&ps->pending_count, 0); | 818 | atomic_set(&ps->pending_count, 0); |
819 | ps->callbacks = NULL; | 819 | ps->callbacks = NULL; |
820 | 820 | ||
821 | ps->metadata_wq = alloc_ordered_workqueue("ksnaphd", WQ_MEM_RECLAIM); | 821 | ps->metadata_wq = alloc_workqueue("ksnaphd", WQ_MEM_RECLAIM, 0); |
822 | if (!ps->metadata_wq) { | 822 | if (!ps->metadata_wq) { |
823 | kfree(ps); | 823 | kfree(ps); |
824 | DMERR("couldn't start header metadata update thread"); | 824 | DMERR("couldn't start header metadata update thread"); |