[PATCH] workqueue: Fix memory ordering race in queue_work*()

Linus Torvalds torvalds at linux-foundation.org
Tue Aug 16 09:58:56 PDT 2022


On Tue, Aug 16, 2022 at 9:22 AM Hector Martin <marcan at marcan.st> wrote:
>
> It's worth pointing out that the workqueue code does *not* pair
> test_and_set_bit() with clear_bit(). It does an atomic_long_set()
> instead

Yes. That code is much too subtle.

And yes, I think those barriers are

 (a) misleading

 (b) don't work with the "serialize bits using spinlock" model at all

It's a good example of "we need to really have a better model for this".

             Linus



More information about the linux-arm-kernel mailing list