Re: [PATCH 2/2] blk-mq: ensure a q_usage_counter reference is held when splitting bios

Jens Axboe
2024-01-11T16:17:43Z

On 1/11/24 9:14 AM, Christoph Hellwig wrote:
> On Thu, Jan 11, 2024 at 09:12:23AM -0700, Jens Axboe wrote:
>> On 1/11/24 6:57 AM, Christoph Hellwig wrote:
>>> q_usage_counter is the only thing preventing us from the limits changing
>>> under us in __bio_split_to_limits, but blk_mq_submit_bio doesn't hold it.
>>>
>>> Change __submit_bio to always acquire the q_usage_counter counter before
>>> branching out into bio vs request based helper, and let blk_mq_submit_bio
>>> tell it if it consumed the reference by handing it off to the request.
>>
>> This causes hangs for me on shutdown/reset:
>
>> which seems to indicate that a reference is being leaked. Haven't poked
>> any further at it, I'll drop these two for now.
>
> Can you send me your .config?

Don't think it's .config related, hit it on my test box and then in my
vm as well. It's likely due to batched allocations, would be my guess.
I can start/halt the vm fine with just a boot, but if I do:

$ ~/git/fio/t/io_uring -p1 -d128 -b512 -s32 -c32 -F1 -B1 -R0 -X1 -P1 /dev/nvme0n1

for just a brief moment, nvme0 will hang on shutdown.

--
Jens Axboe