From: Bart Van Assche <bvanassche@acm.org>
To: Jens Axboe <axboe@kernel.dk>,
Damien Le Moal <Damien.LeMoal@wdc.com>,
"fio@vger.kernel.org" <fio@vger.kernel.org>
Subject: Re: [PATCH] zbd: Restore check_swd()
Date: Fri, 28 Sep 2018 13:25:04 -0700 [thread overview]
Message-ID: <1538166304.53591.6.camel@acm.org> (raw)
In-Reply-To: <b3169357-303b-30e2-9018-d889e53c6a97@kernel.dk>
On Fri, 2018-09-28 at 08:54 -0600, Jens Axboe wrote:
> + for (z = zb; z < ze; z++) {
> + pthread_mutex_lock(&z->mutex);
> + swd += z->wp - z->start;
> + }
> + pthread_mutex_lock(&f->zbd_info->mutex);
>
> Can 'z' ever end up being f->zbd_info? That would surely explain the
> deadlock.
Hi Jens,
f->zbd_info and z have a different type so unless something very weird is going
on &z->mutex can't be identical to &f->zbd_info->mutex.
What I think is going on is traditional lock inversion: check_swd() triggers
lock inversion if it is called while any of the z->mutex objects are held. One
such mutex is held where Damien tried to restore the calls of this function. I
will submit a patch that inserts these calls elsewhere.
Bart.
next prev parent reply other threads:[~2018-09-28 20:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-27 2:16 [PATCH] zbd: Restore check_swd() Damien Le Moal
2018-09-28 3:41 ` Bart Van Assche
2018-09-28 3:53 ` Jens Axboe
2018-09-28 4:04 ` Damien Le Moal
2018-09-28 5:48 ` Damien Le Moal
2018-09-28 14:54 ` Jens Axboe
2018-09-28 20:25 ` Bart Van Assche [this message]
2018-09-28 20:31 ` Jens Axboe
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=1538166304.53591.6.camel@acm.org \
--to=bvanassche@acm.org \
--cc=Damien.LeMoal@wdc.com \
--cc=axboe@kernel.dk \
--cc=fio@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.