Re: [patch] measurements, numbers about CONFIG_OPTIMIZE_INLINING=yimpact

From: Linus Torvalds
Date: Fri Jan 09 2009 - 14:49:36 EST




On Fri, 9 Jan 2009, Matthew Wilcox wrote:
>
> Now, I'm not going to argue the directIO code is a shining example of
> how we want things to look, but we don't really want ten arguments
> being marshalled into a function call; we want gcc to inline the
> direct_io_worker() and do its best to optimise the whole thing.

Well, except we quite probably would be happier with gcc not doing that,
than with gcc doing that too often.

There are exceptions. If the caller is really small (ie a pure wrapper
that perhaps just does some locking around the call), then sure, inlining
a large function that only gets called from one place does make sense.

But if both the caller and the callee is large, like in your example, then
no. DON'T INLINE IT. Unless we _tell_ you, of course, which we probably
shouldn't do.

Why? Becuase debugging is more important. And deciding to inline that, you
probably decided to inline something _else_ too. And now you've quite
possibly blown your stackspace.

Linus
--
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/