Re: [PATCH v9] loop: defer the queue limits clear to a workqueue

From: Tao Cui

Date: Thu Dec 03 2026 - 03:08:30 EST


Hello, Bart,

在 2026/12/2 23:13, Bart Van Assche 写道:
> On 12/1/26 5:14 AM, Tao Cui wrote:
>> Done: the work item is now queued on a dedicated unbounded workqueue
>> (loopc%d) instead of lo->workqueue, and lo_free_disk() drains that
>> workqueue before the loop_device is freed, so outstanding clear work
>> items cannot outlive it.
>>
>> On the deadlock concern: I could not trigger it on either queue
>> placement, despite trying fairly hard with an adversarial mix of
>> LOOP_SET_BLOCK_SIZE, LOOP_SET_DIRECT_IO, write-zeroes and rebind churn
>> (600 rebinds, 10,000 queue-limits updates, up to 56 concurrent failing
>> requests, stacked loop devices) under PROVE_LOCKING.  The backing
>> files in these tests are memory-backed, so the drain times are short.
>> The failure reporting stays at exactly one per binding throughout, and
>> no report, hang or deadlock was observed with either the shared or the
>> dedicated workqueue.
>>
>> The full suite (loop/011, the concurrency sweep and the mkfs/unbind
>> stress) also runs clean on both kernels.
> Has v10 of this patch already been posted?
>
Not yet, that message was design-only, and I held the patch pending
your feedback on the direction. Posting it as v10 in this thread now.

Thanks,
Tao.

> Thanks,
>
> Bart.