Re: [PATCH v2] workqueue: Fix false positive stall reports

From: Tejun Heo

Date: Tue Mar 24 2026 - 10:17:59 EST


On Tue, Mar 24, 2026 at 11:01:30AM +0100, Petr Mladek wrote:
> You know, the code makes my head spin because it violates the usual
> locking rules. The lock should serialize 2 or more writes/reads.
> It works only when all the reads/writes are done under the lock.
> But it is not the case here.

It's unusual but not unique. We would have used spin_unlock_wait() here (w/
rmb()) here but we don't have that anymore. Maybe a clearer way to indicate
what's going on now is just doing lock/unlock() cycle without doing anything
inside, but, as long as the comment explains what's going on, I think either
way is fine. So, if anyone can improve the comment without writing a novel,
plesae go ahead.

Thanks.

--
tejun