Re: [PATCH] block: don't use submit_bio_noacct_nocheck in blk_zone_wplug_bio_work

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/19/25 6:29 PM, Damien Le Moal wrote:
On 6/19/25 02:13, Bart Van Assche wrote:

On 6/17/25 10:56 PM, Damien Le Moal wrote:
Can you check exactly the path that is being followed ? (your
  > backtrace does not seem to have everything)

Hmm ... it is not clear to me why this information is required? My
understanding is that the root cause is the same as for the deadlock
fixed by Christoph:
1. A bio is queued onto zwplug->bio_list. Before this happens, the
     queue reference count is increased by one.
2. A value is written into a block device sysfs attribute and queue
     freezing starts. The queue freezing code waits for completion of
     all bios on zwplug->bio_list because the reference count owned by
     these bios is only released when these bios complete.
3. blk_zone_wplug_bio_work() dequeues a bio from zwplug->bio_list,
     calls dm_submit_bio() through a function pointer, dm_submit_bio()
     calls submit_bio_noacct() indirectly and submit_bio_noacct() calls
     bio_queue_enter() indirectly. bio_queue_enter() sees that queue
     freezing has started and waits until the queue is unfrozen.
4. A deadlock occurs because (2) and (3) wait for each other
     indefinitely.

Then we need to split DM BIOs immediately on submission, always.
So something like this totally untested patch should solve the issue.
Care to test ?

(back in the office after four days off work)

Hi Damien,

Hmm ... it is not clear to me how a patch that modifies when bios are
split could address the deadlock scenario described above? What am I
missing? Additionally, hadn't Christoph requested not to split bios at
the top of the device driver stack?

The patch that I posted one month ago is sufficient to fix this
deadlock. See also
https://lore.kernel.org/linux-block/20250522171405.3239141-1-bvanassche@xxxxxxx/

Thanks,

Bart.






[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux