[PATCH] block: avoild hang when bio_list is non-NULL in submit_bio_wait()
Jiucheng Xu
jiucheng.xu at amlogic.com
Tue Mar 3 13:03:04 AEDT 2026
On 3/2/2026 10:23 PM, Gao Xiang wrote:
> [Some people who received this message don't often get email from
> hsiangkao at linux.alibaba.com. Learn why this is important at https://
> aka.ms/LearnAboutSenderIdentification ]
>
> [ EXTERNAL EMAIL ]
>
> Hi Christoph,
>
> On 2026/3/2 21:50, Christoph Hellwig wrote:
>> On Mon, Mar 02, 2026 at 10:51:03AM +0800, Jiucheng Xu via B4 Relay wrote:
>>> From: Jiucheng Xu <jiucheng.xu at amlogic.com>
>>>
>>> When current->bio_list is non-NULL in submit_bio_wait(),
>>> submit_bio_noacct_nocheck appends bio to bio_list but skips IO
>>> submission, causing submit_bio_wait() to hang indefinitely.
>>>
>>> Fix this by temporarily backup bio_list, setting bio_list to
>>> NULL before calling submit_bio(), then restoring bio_list
>>> after submit_bio() returns.
>>
>> No. Fix this by not doing something that is a bad idea.
>>
>>> I've trimmed down the call stack, as follows:
>>>
>>> f2fs_submit_read_io
>>> submit_bio
>>> mmc_blk_mq_recovery
>>> z_erofs_endio
>>> vm_map_ram
>>
>> ->bi_end_io code really should not be having random in_atomic()
>> checks that make it completely different, but even if they have
>
> Thanks for the head-up.
>
> For this part, I'm pretty sure we need this particular one
> otherwise the scheduling performance (latency sensitive)
> is unacceptable for all Android phone users.
>
>> that need to use GFP_NOIO.
>
> Yes, it should make vm_map_ram() in the end_io path use
> GFP_NOIO instead.
>
> Jiucheng, could you add memalloc_noio_{save,restore}() to
> wrap up this path?
Thanks for Christoph's and Xiang's comments, I will try it. Thanks!
Best Regards,
Jiucheng
More information about the Linux-erofs
mailing list