From: David Teigland <teigland@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH 13/18] [try #2] DLM: fix conversion deadlock when DLM_LKF_NODLCKWT flag is set
Date: Tue, 12 Sep 2017 11:56:20 -0500 [thread overview]
Message-ID: <20170912165620.GA22518@redhat.com> (raw)
In-Reply-To: <a99aef29e2464d7f94b95b57c4b34912@TGXML394.toshiba.local>
On Tue, Sep 12, 2017 at 09:01:31AM +0000, tsutomu.owa at toshiba.co.jp wrote:
> When the DLM_LKF_NODLCKWT flag was set, even if conversion deadlock
> was detected, the caller of can_be_granted() was unknown.
> We change the behavior of can_be_granted() and change it to detect
> conversion deadlock regardless of whether the DLM_LKF_NODLCKWT flag
> is set or not. And depending on whether the DLM_LKF_NODLCKWT flag
> is set or not, we change the behavior at the caller of can_be_granted().
Thanks for sorting this out. Could we expand this with a description of
the externally visible effects from the change?
> @@ -2549,6 +2548,17 @@ static int grant_pending_convert(struct dlm_rsb *r, int high, int *cw,
> log_print("WARN: pending deadlock %x node %d %s",
> lkb->lkb_id, lkb->lkb_nodeid, r->res_name);
> dlm_dump_rsb(r);
> + /*
> + * If DLM_LKB_NODLKWT flag is set and conversion
> + * deadlock is detected, we request blocking AST and
> + * down (or cancel) conversion.
> + */
> + if (lkb->lkb_exflags & DLM_LKF_NODLCKWT &&
> + lkb->lkb_highbast < lkb->lkb_rqmode) {
> + queue_bast(r, lkb, lkb->lkb_rqmode);
> + lkb->lkb_highbast = lkb->lkb_rqmode;
> + }
Is this the main change in behavior you are looking for? It seems to make
sense. Do you find that this case is occurring during normal operation?
I did not previously expect that this code path would be used, but if it
is, then we should change the FIXME comment to explain how and when it
happens, and the warning and dump_rsb should be suppresssed.
> +
> continue;
> }
>
> @@ -3124,7 +3134,7 @@ static int do_convert(struct dlm_rsb *r, struct dlm_lkb *lkb)
> deadlock, so we leave it on the granted queue and return EDEADLK in
> the ast for the convert. */
>
> - if (deadlk) {
> + if (deadlk && !(lkb->lkb_exflags & DLM_LKF_NODLCKWT)) {
> /* it's left on the granted queue */
> revert_lock(r, lkb);
> queue_cast(r, lkb, -EDEADLK);
> --
> 2.7.4
next prev parent reply other threads:[~2017-09-12 16:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-12 9:01 [Cluster-devel] [PATCH 13/18] [try #2] DLM: fix conversion deadlock when DLM_LKF_NODLCKWT flag is set tsutomu.owa
2017-09-12 16:56 ` David Teigland [this message]
2017-09-14 9:31 ` tsutomu.owa
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=20170912165620.GA22518@redhat.com \
--to=teigland@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.