Messages in this thread | | | Date | Mon, 5 Jul 2021 16:21:36 +0100 | From | Will Deacon <> | Subject | Re: [PATCH] Documentation/atomic_t: Document cmpxchg() vs try_cmpxchg() |
| |
On Mon, Jul 05, 2021 at 05:07:41PM +0200, Peter Zijlstra wrote: > On Mon, Jul 05, 2021 at 04:00:01PM +0200, Peter Zijlstra wrote: > > > No, when try_cmpxchg() fails it will update oldp. This is the reason old > > is now a pointer too. > > Since you're not the first person confused by this, does the below > clarify? > > --- > Subject: Documentation/atomic_t: Document cmpxchg() vs try_cmpxchg() > From: Peter Zijlstra <peterz@infradead.org> > Date: Mon Jul 5 17:00:24 CEST 2021 > > There seems to be a significant amount of confusion around the 'new' > try_cmpxchg(), despite this being more like the C11 > atomic_compare_exchange_*() family. Add a few words of clarification > on how cmpxchg() and try_cmpxchg() relate to one another. > > Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> > --- > Documentation/atomic_t.txt | 41 +++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 41 insertions(+)
With the "CMPXHG" typo fixed:
Acked-by: Will Deacon <will@kernel.org>
Will
| |