lkml.org 
[lkml]   [2022]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] workqueue: Fix memory ordering race in queue_work*()
On Mon, Aug 15, 2022 at 10:27:10PM -0700, Linus Torvalds wrote:
>
> The bug seems to go back to commit e986a0d6cb36 ("locking/atomics,
> asm-generic/bitops/atomic.h: Rewrite using atomic_*() APIs"), and the
> fix looks to be as simple as just removing that early READ_ONCE return
> case (test_and_clear has the same bug).
>
> Will?

I think this is the source of all this:

commit 61e02392d3c7ecac1f91c0a90a8043d67e081846
Author: Will Deacon <will@kernel.org>
Date: Tue Feb 13 13:30:19 2018 +0000

locking/atomic/bitops: Document and clarify ordering semantics for failed test_and_{}_bit()

Unfortunately it doesn't work because lots of kernel code rely on
the memory barrier semantics of test_and_set_bit.

If ARM really wants this change, then eitehr create a new API
for it or audit every single existing use in the kernel.

Patching the documentation and then relying on it is magical thinking.

Cheers,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

\
 
 \ /
  Last update: 2022-08-16 10:33    [W:0.120 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site