Re: [PATCH] Revert "driver: block: release the lo_work_lock before queue_work"

From: Christoph Hellwig
Date: Tue Feb 18 2025 - 11:34:02 EST


On Tue, Feb 18, 2025 at 02:58:35PM +0800, zhaoyang.huang wrote:
> From: Zhaoyang Huang <zhaoyang.huang@xxxxxxxxxx>
>
> This reverts commit ad934fc1784802fd1408224474b25ee5289fadfc.
>
> loop_queue_work should be strictly serialized to loop_process_work since
> the lo_worker could be freed without noticing new work has been queued
> again.

Btw, if you care about the lock contention you might want to split out
the trivial non-cgroup version into a separate helper or at least
branch and reduce the lock hold time there.