Re: locking/atomic: Introduce atomic_try_cmpxchg()

From: Peter Zijlstra
Date: Sat Mar 25 2017 - 14:21:15 EST


On Sat, Mar 25, 2017 at 11:00:44AM -0700, Linus Torvalds wrote:
> On Sat, Mar 25, 2017 at 12:51 AM, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
> > On Fri, Mar 24, 2017 at 10:23:29PM +0100, Peter Zijlstra wrote:
> >
> >> I'll try and redo the patches that landed in tip and see what it does
> >> for total vmlinux size somewhere tomorrow.
> >
> > text data bss dec hex filename
> > 10726413 4540256 843776 16110445 f5d36d defconfig-build/vmlinux.pre
> > 10730509 4540256 843776 16114541 f5e36d defconfig-build/vmlinux.post
10730445 4540256 843776 16114477 f5e32d defconfig-build/vmlinux

> >
> > :-(
>
> Hmm. But you are comparing against the *broken* version that did the
> unconditional store of the result.

Well, only broken if not used on stack local variables, but yes.

> You should at least compare against the fixed version with the
> conditional store. That's the one that was hard to get good code
> generation from, wasn't it?

Added above, a few bytes smaller than the shiny new one actually.