All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shaohua Li <shli@kernel.org>
To: Guoqing Jiang <gqjiang@suse.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: [PATCH 6/8] md-cluster: make resync lock also could be interruptted
Date: Mon, 1 Aug 2016 15:29:46 -0700	[thread overview]
Message-ID: <20160801222946.GC18810@kernel.org> (raw)
In-Reply-To: <1469686612-16126-6-git-send-email-gqjiang@suse.com>

On Thu, Jul 28, 2016 at 02:16:50AM -0400, Guoqing Jiang wrote:
> When one node is perform resync or recovery, other nodes
> can't get resync lock and could block for a while before
> it holds the lock, so we can't stop array immediately for
> this scenario.
> 
> To make array could be stop quickly, we check MD_CLOSING
> in dlm_lock_sync_interruptible to make us can interrupt
> the lock request.

if the thread is waiting for the resync lock and you set MD_CLOSING, where do
you wake up the thread?

 
> Reviewed-by: NeilBrown <neilb@suse.com>
> Signed-off-by: Guoqing Jiang <gqjiang@suse.com>
> ---
>  drivers/md/md-cluster.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/md/md-cluster.c b/drivers/md/md-cluster.c
> index f3d584e..0984771 100644
> --- a/drivers/md/md-cluster.c
> +++ b/drivers/md/md-cluster.c
> @@ -157,7 +157,8 @@ static int dlm_lock_sync_interruptible(struct dlm_lock_resource *res, int mode,
>  		return ret;
>  
>  	wait_event(res->completion.wait,
> -		   res->completion.done || kthread_should_stop());
> +		   res->completion.done || kthread_should_stop()
> +					|| test_bit(MD_CLOSING, &mddev->flags));
>  	if (!res->completion.done) {
>  		/*
>  		 * the convert queue contains the lock request when request is
> @@ -1026,7 +1027,7 @@ static void metadata_update_cancel(struct mddev *mddev)
>  static int resync_start(struct mddev *mddev)
>  {
>  	struct md_cluster_info *cinfo = mddev->cluster_info;
> -	return dlm_lock_sync(cinfo->resync_lockres, DLM_LOCK_EX);
> +	return dlm_lock_sync_interruptible(cinfo->resync_lockres, DLM_LOCK_EX, mddev);
>  }
>  
>  static int resync_info_update(struct mddev *mddev, sector_t lo, sector_t hi)
> -- 
> 2.6.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2016-08-01 22:29 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-28  6:16 [PATCH 1/8] md-cluster: call md_kick_rdev_from_array once ack failed Guoqing Jiang
2016-07-28  6:16 ` [PATCH 2/8] md-cluster: use FORCEUNLOCK in lockres_free Guoqing Jiang
2016-07-28  6:16 ` [PATCH 3/8] md-cluster: remove some unnecessary dlm_unlock_sync Guoqing Jiang
2016-07-28  6:16 ` [PATCH 4/8] md-cluster: introduce dlm_lock_sync_interruptible to fix tasks hang Guoqing Jiang
2016-08-01 22:20   ` Shaohua Li
2016-08-02  3:24     ` Guoqing Jiang
2016-08-02 22:36       ` Shaohua Li
2016-08-03  2:39         ` Guoqing Jiang
2016-08-06  3:59           ` Shaohua Li
2016-07-28  6:16 ` [PATCH 5/8] md: changes for MD_STILL_CLOSED flag Guoqing Jiang
2016-07-28  6:16 ` [PATCH 6/8] md-cluster: make resync lock also could be interruptted Guoqing Jiang
2016-08-01 22:29   ` Shaohua Li [this message]
2016-08-02  1:38     ` Guoqing Jiang
2016-07-28  6:16 ` [PATCH 7/8] md-cluster: clean related infos of cluster Guoqing Jiang
2016-07-28  6:16 ` [PATCH 8/8] md-cluster: remove EXPERIMENTAL info Guoqing Jiang
2016-08-01 21:58 ` [PATCH 1/8] md-cluster: call md_kick_rdev_from_array once ack failed Shaohua Li
2016-08-02  3:21   ` Guoqing Jiang
     [not found]   ` <579FF771.4060007@suse.com>
2016-08-02 22:17     ` Shaohua Li
2016-08-03  2:15       ` Guoqing Jiang
2016-08-03  2:26 ` [PATCH V2 " Guoqing Jiang

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=20160801222946.GC18810@kernel.org \
    --to=shli@kernel.org \
    --cc=gqjiang@suse.com \
    --cc=linux-raid@vger.kernel.org \
    /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.