lkml.org 
[lkml]   [2011]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 13/15] x86: add cmpxchg_flag() variant
    On 08/24/2011 12:27 PM, Christoph Lameter wrote:
    > On Wed, 24 Aug 2011, Jeremy Fitzhardinge wrote:
    >
    >> I only looked in arch/x86, but I didn't find any that were
    >> straightforward candidates for cmpxchg_flag.
    > Look at core code: mm/slub.c

    These changes are currently only in arch/x86. I haven't looked at
    extending the cmpxchg API kernel-wide.

    > 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.

    Sure. And the asm goto() variant avoids the sete and subsequent
    gcc-generated test, but at the cost of generating a number of
    unnecessary jumps - so it doesn't look like much of a win. Perhaps a
    hypothetical gcc extension to add "cc" as an output for asms would help,
    but that's conjecture at this point.


    J


    \
     
     \ /
      Last update: 2011-08-25 00:45    [W:0.020 / U:121.296 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site