Re: [2.6 patch] kernel/sched*: optimize inlining

From: Robert Hancock
Date: Sun May 11 2008 - 13:24:10 EST


Adrian Bunk wrote:
On Sun, May 11, 2008 at 01:18:20PM +0200, Andreas Mohr wrote:
[manual reply, no access to original content]

Hi,

rather NACKish here (from my minor side, that is, since there are no
useful explanations, and in the case of a lack of explanations no
backing numbers either which would have been helpful to resolve this ;).

"x86: add optimized inlining"
(http://kerneltrap.org/mailarchive/git-commits-head/2008/4/26/1612644)
does not really say anything relevant to your patch, AFAICS.

That one simply says that previously every inline was force-inlined (ugh),
which now gcc is allowed to properly decide by itself now. This, however,
does _NOT_ imply that it's now somehow fully sufficient for a perfect outcome
to simply remove all open-coded "inline"s.

They both do the same - gcc is no longer forced to inline these functions.

With either my patch or the "optimized inlining" it's 100% gcc's choice whether or not to inline functions marked as "inline" in kernel/sched* .

If you didn't complain when "x86: add optimized inlining" got into Linus' tree you can't validly complain about my patch.

It's not really the same thing. Not forcing gcc to do the inlining where it's marked is one thing, but removing the hint to inline the function entirely is something else. In this case without the hint it clearly makes the wrong decision, since there is no reason to not inline a function that just calls another function.

GCC 4.3 is supposed to have some improvements in this area with pre-inline optimization and early inlining, but older gcc versions may still have this issue.
--
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/