From: Jens Axboe <axboe@kernel.dk>
To: Damien Le Moal <Damien.LeMoal@wdc.com>,
"fio@vger.kernel.org" <fio@vger.kernel.org>
Cc: Bart Van Assche <bvanassche@acm.org>
Subject: Re: [PATCH] zbd: Restore check_swd()
Date: Fri, 28 Sep 2018 08:54:12 -0600 [thread overview]
Message-ID: <b3169357-303b-30e2-9018-d889e53c6a97@kernel.dk> (raw)
In-Reply-To: <BLUPR0401MB16361E2E31658E293C266970E7EC0@BLUPR0401MB1636.namprd04.prod.outlook.com>
On 9/27/18 11:48 PM, Damien Le Moal wrote:
> Jens,
>
> On 2018/09/28 13:04, Damien Le Moal wrote:
>> Jens,
>>
>> On 2018/09/28 12:53, Jens Axboe wrote:
>>> On 9/26/18 8:16 PM, Damien Le Moal wrote:
>>>> As check_swd() is useful for debugging, revert its removal done with
>>>> commit d60be7d51cbb ("zbd: Remove unused function and variable").
>>>
>>> The problem with dead code is that it's often forgotten when
>>> other changes are made, and then it doesn't even compile or
>>> work anymore.
>>>
>>> I'd be happier if this was dependent on some debug static
>>> bool instead, ala:
>>>
>>> static bool zbd_debug;
>>>
>>> And then have check_swd() do
>>>
>>> if (!zbd_debug)
>>> return;
>>>
>>> instead of hiding everything behind an #if 0.
>>
>> OK. No problem. I will update and send a v2.
>>
>> (and another patch to fix the incorrect comments signaled by Bart)
>>
>> Thanks !
>
> Not sending a fix after all: with check_swd() enabled, I am getting a deadlock
> between check_swd() and zbd_file_reset() on a zone mutex in test 29 when running
> against regular nullb.
>
> That needs to be investigated. But I do not have the time to do so right away.
>
> Bart,
>
> If you can, please also look at it ? I do not see anything obviously wrong. It
> may be a very subtle race.
+ 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.
--
Jens Axboe
next prev parent reply other threads:[~2018-09-28 14:54 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 [this message]
2018-09-28 20:25 ` Bart Van Assche
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=b3169357-303b-30e2-9018-d889e53c6a97@kernel.dk \
--to=axboe@kernel.dk \
--cc=Damien.LeMoal@wdc.com \
--cc=bvanassche@acm.org \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox