[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4E5527C2.8000801@goop.org>
Date: Wed, 24 Aug 2011 09:33:06 -0700
From: Jeremy Fitzhardinge <jeremy@...p.org>
To: Christoph Lameter <cl@...ux.com>
CC: "H. Peter Anvin" <hpa@...or.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...e.hu>,
the arch/x86 maintainers <x86@...nel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Nick Piggin <npiggin@...nel.dk>,
Jeremy Fitzhardinge <jeremy.fitzhardinge@...rix.com>
Subject: Re: [PATCH 13/15] x86: add cmpxchg_flag() variant
On 08/24/2011 06:53 AM, Christoph Lameter wrote:
> On Tue, 23 Aug 2011, Jeremy Fitzhardinge wrote:
>
>> However, having prototyped it, I dunno, it doesn't really seem like much
>> of a win for all the extra code it adds. I just can't get too excited
>> about an extra test instruction adjacent to a monster like a locked
>> cmpxchg. The jump variant avoids the test, but gcc still generates some
>> pretty bogus stuff:
> There are also unlocked cmpxchges in use.
I only looked in arch/x86, but I didn't find any that were
straightforward candidates for cmpxchg_flag.
> And if the cmpxchg is a 16 byte
> cmpxchg (cmpxchg_double) then the comparison is getting more expensive.
We're talking about the difference between cmpxchg_flag() - which does
a sete based on the flags set up cmpxchg - and a variant based on "asm
goto" which could, in principle, avoid the need for sete by allowing a
control flow statment to directly use the asm goto's conditional jump.
The performance of both is invariant wrt the cmpxchg argument size.
J
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists