[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6e729890-7374-4335-ab7d-ead00775057e@kernel.dk>
Date: Wed, 14 Aug 2024 14:22:20 -0600
From: Jens Axboe <axboe@...nel.dk>
To: Bart Van Assche <bvanassche@....org>,
Li Lingfeng <lilingfeng@...weicloud.com>, hch@....de, jack@...e.cz,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: yukuai1@...weicloud.com, yukuai3@...wei.com, houtao1@...wei.com,
yi.zhang@...wei.com, yangerkun@...wei.com, lilingfeng3@...wei.com
Subject: Re: [PATCH] block: Fix potential deadlock warning in
blk_mq_mark_tag_wait
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@...wei.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
Powered by blists - more mailing lists