[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4E555FBB.3020906@zytor.com>
Date: Wed, 24 Aug 2011 13:31:55 -0700
From: "H. Peter Anvin" <hpa@...or.com>
To: Christoph Lameter <cl@...ux.com>
CC: Jeremy Fitzhardinge <jeremy@...p.org>,
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 12:27 PM, Christoph Lameter wrote:
>
> Indeed for sete the size of the argument does not matter. Look at
> percpu_cmpxchg_double() and cmpxchg_double() in arch/x86/include for some
> of the functions I wrote. The sete is used to avoid the double word
> comparisons that would otherwise have been necessary.
>
> But still the solution with the flags would save another instruction and
> the generated code would not be as ugly. For not only do you have an
> additional sete you will then also have to check the result again. This
> means at least two additional instruction.
>
The sete is actually more expensive than the compare for the single-word
case. The double-word case is a different matter.
-hpa
--
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