Re: [patch] measurements, numbers about CONFIG_OPTIMIZE_INLINING=y impact

Linus Torvalds
2009-01-09T19:48:41Z

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