----- Original Message ----- > I saw this kind io hang in ltp/fs_fill test reliably and the loop is > over image in tmpfs: > > https://lkml.org/lkml/2020/7/26/77 > > And I have verified that the following patch can fix the issue: > > https://lore.kernel.org/linux-block/bc5fa941-3b7c-f28e-dd46-1a1d6e5c40a8@xxxxxxxxx/T/#t Thanks, I'll test your patch with my setup. In my case, I traced requests going up to blk_mq_sched_insert_requests(), but they never made it to loop driver code (loop_queue_rq / lo_complete_rq), so I assumed they are getting lost somewhere in mq scheduling. After hang, there were always several requests stuck "inflight": # cat /sys/kernel/debug/block/loop0/rqos/wbt/inflight 0: inflight 41 1: inflight 0 2: inflight 0 With some additional traces I could see requests being at dispatch list and state == 0, which appears to fit description of problem you've seen: blk_mq_sched_insert_requests: blk_mq_sched_insert_requests hctx: ffff000168598000, ctx: fffffdffbff16dc0 wbt_wait: wbt_wait rqos: ffff00016a5e1358, rqw: ffff00016a5e1388, bio: ffff0000da6bbd00, inflight: 41 <wbt_wait goes to sleep> crash> bio.bi_disk ffff0000da6bbd00 bi_disk = 0xffff000168599800 crash> gendisk.disk_name 0xffff000168599800 disk_name = "loop0\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000" crash> blk_mq_hw_ctx.queue 0xffff000168598000 queue = 0xffff000117c06800 crash> request_queue.rq_qos 0xffff000117c06800 rq_qos = 0xffff00016a5e1358 crash> blk_mq_hw_ctx.state 0xffff000168598000 state = 0 crash> list blk_mq_hw_ctx.dispatch -h 0xffff000168598000 | wc -l 42 Regards, Jan