Re: [PATCH -v7][RFC]: mutex: implement adaptive spinning



Linus Torvalds wrote:

First off, gcc _does_ have a perfectly fine notion of how heavy-weight an
"asm" statement is: just count it as a single instruction (and count the
argument setup cost that gcc _can_ estimate).


True. It's not what it's doing, though. It looks for '\n' and ';'
characters, and counts the maximum instruction size for each possible
instruction.

The reason why is that gcc's size estimation is partially designed to
select what kind of branches it needs to use on architectures which have
more than one type of branches. As a result, it tends to drastically
overestimate, on purpose.

-hpa

--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: Building an ARM-GCC toolchain
    ... tar zxvf binutils-$BINUTILS_VER.tar.gz ... rm -rf gcc-$GCC_VER gcc ... # extracting newlib - needed for gcc ... instruction: `orrhs result,result,curbit,lsr' ...
    (comp.arch.embedded)
  • Re: Confused with malloc
    ... Ok, ok, ANSI is always right, while my parody of a scientific ... For example on "gcc -mrtd". ... # Use a different function-calling convention, ... # instruction, which pops their arguments while returning. ...
    (comp.lang.c)
  • Re: Building an ARM-GCC toolchain
    ... tar zxvf binutils-$BINUTILS_VER.tar.gz ... rm -rf gcc-$GCC_VER gcc ... # extracting newlib - needed for gcc ... instruction: `orrhs result,result,curbit,lsr' ...
    (comp.arch.embedded)
  • Re: [PATCH -v4 9/9] tracing: add function graph tracer support for MIPS
    ... the gcc tool tell us they are not incompatible when we use both of them ... and also, I have tried to just search "Save" instruction, if I find one, ... I'll have to search the ABI documentation about calling _mcount in MIPS. ... the smallest address of stack, but it not always be 0, which should ...
    (Linux-Kernel)
  • Re: [BUG] NULL pointer deref with rcutorture
    ... Does the above "call" instruction ... Compiler is gcc version 4.2.4 ... I don't see much opportunity for a page fault here... ...
    (Linux-Kernel)