Re: [Bug #13185] New x86 warning



Handled-By : Andi Kleen <andi@xxxxxxxxxxxxxx>
Patch : http://patchwork.kernel.org/patch/19330/
http://patchwork.kernel.org/patch/19406/

This patch regresses on older GCC versions

I don't think that's correct. There's been a demonstration that some gcc
versions don't inline as many memcpy as without the patch, but
that's not necessarily a pessimization. In fact 64bit used
the same gcc based memcpy forever and there's no indication that
the 64bit kernel runs slower than the 32bit kernel because
of this (in fact I have some indications that the 64bit kernel
runs faster)

Also the general trend in the kernel is to inline less
things because it has been demonstrated many times that
the function call overhead isn't that great, so I don't
see why memcpy should be different from all other
functions in this regard.

What Linus asked for was a demonstration that there's
no catastrophic regression (as in no trivial cases inlined anymore)
and I think that was demonstrated by the numbers.

Also the patch definitely shrunk the kernel and at least the
standard wisdom is that for micro optimizations icache optimizations
are the most useful one. In this sense the patch was a improvement.

and doesnt really address
the GCC false positive warning either, it just removes the inline
function that triggers the warning.

Interesting sophistry.

Yes of course the patch doesn't fix gcc -- the goal is to remove the warning
message (and also quite some ugly obsolete code) from the kernel build, not
fix gcc.

-Andi

--
ak@xxxxxxxxxxxxxxx -- Speaking for myself only.
--
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: system gets stuck in a lock during boot
    ... on the latest kernel and seeing whether that fixes the lockup? ... 'backtrack' the bisection, ... At the moment I don't have a problem applying a patch to the ... gcc version: 4.5.0 20090730 ...
    (Linux-Kernel)
  • Re: system gets stuck in a lock during boot
    ... on the latest kernel and seeing whether that fixes the lockup? ... 'backtrack' the bisection, ... At the moment I don't have a problem applying a patch to the ... gcc version: 4.5.0 20090730 ...
    (Linux-Kernel)
  • [patch] measurements, numbers about CONFIG_OPTIMIZE_INLINING=y impact
    ... gcc _does_ have a perfectly fine notion of how heavy-weight ... an "asm" statement is: just count it as a single instruction (and count ... I doubt that it's the inline asm that was the biggest reason ... size increase/decrease of the core kernel, ...
    (Linux-Kernel)
  • Re: [PATCH -v7][RFC]: mutex: implement adaptive spinning
    ... I just ran a sample build for x86-64 with gcc 4.3.0, ... As shown by the delta from Andi's patch, ... inline a higher level of inline functions for the same bogus reason. ... weight of the asm statement... ...
    (Linux-Kernel)
  • Re: system gets stuck in a lock during boot
    ... on the latest kernel and seeing whether that fixes the lockup? ... 'backtrack' the bisection, ... At the moment I don't have a problem applying a patch to the ... gcc version: 4.5.0 20090730 ...
    (Linux-Kernel)