From: Tejun Heo <tj@kernel.org>
To: Hector Martin <marcan@marcan.st>
Cc: Will Deacon <will@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
jirislaby@kernel.org, Marc Zyngier <maz@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Boqun Feng <boqun.feng@gmail.com>,
Catalin Marinas <catalin.marinas@arm.com>,
Oliver Neukum <oneukum@suse.com>,
Roman Pen <roman.penyaev@profitbricks.com>,
Asahi Linux <asahi@lists.linux.dev>,
Linux ARM <linux-arm-kernel@lists.infradead.org>,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] workqueue: Fix memory ordering race in queue_work*()
Date: Mon, 15 Aug 2022 09:10:35 -1000 [thread overview]
Message-ID: <YvqaK3hxix9AaQBO@slm.duckdns.org> (raw)
In-Reply-To: <20220815175810.17780-1-marcan@marcan.st>
On Tue, Aug 16, 2022 at 02:58:10AM +0900, Hector Martin wrote:
> This has been broken since the dawn of time, and it was incompletely
> fixed by 346c09f80459, which added the necessary barriers in the work
> execution path but failed to account for the missing barrier in the
> test_and_set_bit() failure case. Fix it by switching to
> atomic_long_fetch_or(), which does have unconditional barrier semantics
> regardless of whether the bit was already set or not (this is actually
> just test_and_set_bit() minus the early exit path).
...
Oh, tricky one and yeah you're absolutely right that it makes no sense to
not guarantee barrier semantics when already pending. I didn't even know
test_and_set_bit() wasn't a barrier when it failed. Thanks a lot for hunting
down and fixing this. Applied to wq/for-6.0-fixes.
Thanks.
--
tejun
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-08-15 19:12 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-15 17:58 [PATCH] workqueue: Fix memory ordering race in queue_work*() Hector Martin
2022-08-15 19:10 ` Tejun Heo [this message]
2022-08-16 4:15 ` Herbert Xu
2022-08-16 5:27 ` Linus Torvalds
2022-08-16 5:36 ` Hector Martin
2022-08-16 5:52 ` Linus Torvalds
2022-08-16 6:28 ` Hector Martin
2022-08-16 7:48 ` Herbert Xu
2022-08-16 8:01 ` Hector Martin
2022-08-16 5:48 ` Herbert Xu
2022-08-16 6:03 ` Linus Torvalds
2022-08-16 13:41 ` Will Deacon
2022-08-16 14:55 ` Boqun Feng
2022-08-16 16:22 ` Hector Martin
2022-08-16 16:43 ` Boqun Feng
2022-08-16 16:58 ` Linus Torvalds
2022-08-16 16:41 ` Linus Torvalds
2022-08-17 5:05 ` Herbert Xu
2022-08-16 17:01 ` Tejun Heo
2022-08-16 16:26 ` Tejun Heo
2022-08-16 17:21 ` Hector Martin
2022-08-16 4:14 ` Herbert Xu
2022-08-16 5:37 ` Hector Martin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YvqaK3hxix9AaQBO@slm.duckdns.org \
--to=tj@kernel.org \
--cc=asahi@lists.linux.dev \
--cc=boqun.feng@gmail.com \
--cc=catalin.marinas@arm.com \
--cc=jirislaby@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcan@marcan.st \
--cc=mark.rutland@arm.com \
--cc=maz@kernel.org \
--cc=oneukum@suse.com \
--cc=peterz@infradead.org \
--cc=roman.penyaev@profitbricks.com \
--cc=stable@vger.kernel.org \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox