From: Mike Snitzer <snitzer@redhat.com>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: device-mapper development <dm-devel@redhat.com>,
Alasdair G Kergon <agk@redhat.com>
Subject: Re: snapshot merging: change timeout to a sequence count
Date: Mon, 7 Dec 2009 11:04:10 -0500 [thread overview]
Message-ID: <20091207160410.GE8917@redhat.com> (raw)
In-Reply-To: <20091207155258.GD8917@redhat.com>
On Mon, Dec 07 2009 at 10:52am -0500,
Mike Snitzer <snitzer@redhat.com> wrote:
> On Mon, Dec 07 2009 at 8:19am -0500,
> Mikulas Patocka <mpatocka@redhat.com> wrote:
>
> > Hi
> >
> > This changes the timeout to a sequence count. And adds a comment.
> >
> > Mikulas
> >
> > ---
> >
> > Avoit the timeout.
> >
> > Use a sequence count to resolve the race. The count increases each time
> > an exception reallocation finishes. Use wait_event() to wait until the count
> > changes.
> >
> > The chunk-reallocation logic is explained in the comment in the patch.
> >
> > Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
>
> Here is an updated patch that falls at the end of my snapshot-merge
> series here:
> http://people.redhat.com/msnitzer/patches/snapshot-merge/kernel/2.6.33/
>
> ---
>
> dm snapshot: change the snapshot reallocation timeout to a sequence count
>
> Use a sequence count to resolve the race between I/O to chunks that are
> about to be merged. The count increases each time an exception
> reallocation finishes. Use wait_event() to wait until the count
> changes.
>
> The chunk-reallocation logic is now explained in snapshot_merge_process()
>
> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
> ---
> drivers/md/dm-snap.c | 45 +++++++++++++++++++++++++++++++++++++++++++--
> 1 file changed, 43 insertions(+), 2 deletions(-)
>
> Index: linux-rhel6/drivers/md/dm-snap.c
> ===================================================================
> --- linux-rhel6.orig/drivers/md/dm-snap.c
> +++ linux-rhel6/drivers/md/dm-snap.c
> @@ -271,6 +271,8 @@ static struct list_head *_origins;
> static struct rw_semaphore _origins_lock;
>
> static DECLARE_WAIT_QUEUE_HEAD(_pending_exception_done);
> +static DEFINE_SPINLOCK(_pending_exception_done_spinlock);
> +static u64 _pending_exception_done_count = 0;
BTW, checkpatch issues the following error:
ERROR: do not initialise statics to 0 or NULL
#24: FILE: drivers/md/dm-snap.c:275:
+static u64 _pending_exception_done_count = 0;
prev parent reply other threads:[~2009-12-07 16:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-07 13:19 [PATCH] snapshot merging: change timeout to a sequence count Mikulas Patocka
2009-12-07 15:52 ` Mike Snitzer
2009-12-07 16:04 ` Mike Snitzer [this message]
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=20091207160410.GE8917@redhat.com \
--to=snitzer@redhat.com \
--cc=agk@redhat.com \
--cc=dm-devel@redhat.com \
--cc=mpatocka@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox