From: Mike Snitzer <snitzer@redhat.com>
To: dm-devel@redhat.com
Subject: [PATCH v3 13/12] dm snapshot: avoid __minimum_chunk_size() during merge
Date: Tue, 17 Nov 2009 15:35:37 -0500 [thread overview]
Message-ID: <20091117203537.GA18929@redhat.com> (raw)
In-Reply-To: <1258474344-10886-1-git-send-email-snitzer@redhat.com>
The merging snapshot already has the origin's __minimum_chunk_size()
stored in the target's 'split_io'. Avoid rediscovering it every call to
snapshot_merge_process().
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
index 34d8c3f..f91ee08 100644
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -730,20 +730,25 @@ static void snapshot_merge_process(struct dm_snapshot *s)
test_again:
/* Reallocate other snapshots; must account for all 'linear_chunks' */
- down_read(&_origins_lock);
- o = __lookup_origin(s->origin->bdev);
must_wait = 0;
- min_chunksize = __minimum_chunk_size(o);
+ /*
+ * Merging snapshot already has the origin's __minimum_chunk_size()
+ * stored in split_io (see: snapshot_merge_resume); avoid rediscovery
+ */
+ min_chunksize = s->ti->split_io;
if (min_chunksize) {
chunk_t n;
+
+ down_read(&_origins_lock);
+ o = __lookup_origin(s->origin->bdev);
for (n = 0; n < io_size; n += min_chunksize) {
r = __origin_write(&o->snapshots, dest.sector + n,
NULL);
if (r == DM_MAPIO_SUBMITTED)
must_wait = 1;
}
+ up_read(&_origins_lock);
}
- up_read(&_origins_lock);
if (must_wait) {
sleep_on_timeout(&_pending_exception_done, HZ / 100 + 1);
goto test_again;
next prev parent reply other threads:[~2009-11-17 20:35 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-17 16:12 [PATCH v3 00/12] snapshot-merge target Mike Snitzer
2009-11-17 16:12 ` [PATCH v3 01/12] dm exception store: add snapshot-merge specific methods Mike Snitzer
2009-11-17 16:12 ` [PATCH v3 02/12] dm exception store: snapshot-merge usage accounting Mike Snitzer
2009-11-17 16:12 ` [PATCH v3 03/12] dm snapshot: add snapshot-merge target Mike Snitzer
2009-11-17 16:12 ` [PATCH v3 04/12] dm snapshot: merge target should not allocate new exceptions Mike Snitzer
2009-11-17 16:12 ` [PATCH v3 05/12] dm snapshot: do not allow more than one merging snapshot Mike Snitzer
2009-11-17 16:12 ` [PATCH v3 06/12] dm snapshot: the merge procedure Mike Snitzer
2009-11-17 16:12 ` [PATCH v3 07/12] dm snapshot: queue writes to an area that is actively being merged Mike Snitzer
2009-11-17 16:12 ` [PATCH v3 08/12] dm snapshot: do not merge a chunk until active writes to it finish Mike Snitzer
2009-11-17 16:12 ` [PATCH v3 09/12] dm snapshot: make exceptions in other snapshots when merging Mike Snitzer
2009-11-17 16:12 ` [PATCH v3 10/12] dm snapshot: make exceptions if merge is dispatching to origin Mike Snitzer
2009-11-17 16:12 ` [PATCH v3 11/12] dm snapshot: redirect accesses to origin if merging snap invalidated Mike Snitzer
2009-11-17 16:12 ` [PATCH v3 12/12] dm snapshot: merge a linear region of chunks using one large IO Mike Snitzer
2009-11-17 16:20 ` Mike Snitzer
2009-11-17 20:35 ` Mike Snitzer [this message]
2009-11-19 11:25 ` [PATCH v3 00/12] snapshot-merge target Andi Kleen
2009-11-19 14:02 ` Mike Snitzer
2009-11-19 14:53 ` Alasdair G Kergon
2009-11-19 17:45 ` Mike Snitzer
2009-11-19 16:08 ` Andi Kleen
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=20091117203537.GA18929@redhat.com \
--to=snitzer@redhat.com \
--cc=dm-devel@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.