mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Bart Van Assche <bvanassche@acm.org>,
	Li Lingfeng <lilingfeng@huaweicloud.com>,
	hch@lst.de, jack@suse.cz, linux-block@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: yukuai1@huaweicloud.com, yukuai3@huawei.com, houtao1@huawei.com,
	yi.zhang@huawei.com, yangerkun@huawei.com,
	lilingfeng3@huawei.com
Subject: Re: [PATCH] block: Fix potential deadlock warning in blk_mq_mark_tag_wait
Date: Wed, 14 Aug 2024 14:22:20 -0600	[thread overview]
Message-ID: <6e729890-7374-4335-ab7d-ead00775057e@kernel.dk> (raw)
In-Reply-To: <ad92f738-9ba5-4cfc-aef5-3918a35e77ec@acm.org>

On 8/14/24 1:52 PM, Bart Van Assche wrote:
> On 8/14/24 4:35 AM, Li Lingfeng wrote:
>> When interrupt is turned on while a lock holding by spin_lock_irq it
>> throws a warning because of potential deadlock.
> 
> Which tool reported the warning? Please mention this in the patch
> description.
>>
>> blk_mq_mark_tag_wait
>>   spin_lock_irq(&wq->lock)
>>        --> turn off interrupt and get lockA
>>   blk_mq_get_driver_tag
>>    __blk_mq_tag_busy
>>     spin_lock_irq(&tags->lock)
>>     spin_unlock_irq(&tags->lock)
>>        --> release lockB and turn on interrupt accidentally
> 
> The above call chain does not match the code in Linus' master tree.
> Please fix this.
> 
>> Fix it by using spin_lock_irqsave to get lockB instead of spin_lock_irq.
>> Fixes: 4f1731df60f9 ("blk-mq: fix potential io hang by wrong 'wake_batch'")
>> Signed-off-by: Li Lingfeng <lilingfeng3@huawei.com>
> 
> Please leave a blank line between the patch description and the section
> with tags.

Please just include the actual lockdep trace rather than a doctored up
one, it's a lot more descriptive. And use the real lock names rather
than turn it into hypotheticals.

-- 
Jens Axboe


  reply	other threads:[~2024-08-14 20:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-14 11:35 Li Lingfeng
2024-08-14 19:52 ` Bart Van Assche
2024-08-14 20:22   ` Jens Axboe [this message]
2024-08-15  1:54     ` Yu Kuai

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=6e729890-7374-4335-ab7d-ead00775057e@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=hch@lst.de \
    --cc=houtao1@huawei.com \
    --cc=jack@suse.cz \
    --cc=lilingfeng3@huawei.com \
    --cc=lilingfeng@huaweicloud.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yangerkun@huawei.com \
    --cc=yi.zhang@huawei.com \
    --cc=yukuai1@huaweicloud.com \
    --cc=yukuai3@huawei.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

all inboxes | Powered by JetHome®