Re: [PATCH] prepare kconfig inline optimization for all architectures

From: Matthew Wilcox
Date: Sun Apr 27 2008 - 13:41:17 EST


On Sun, Apr 27, 2008 at 08:22:35PM +0300, Adrian Bunk wrote:
> I'm looking at it from a different angle, all code in the kernel should
> follow the following rules [1]:
> - no functions in .c files should be marked inline
> - all functions in headers should be static inline
> - all functions in headers should either be very small or collapse
> to become very small after inlining
>
> I can simply not see any usecase for a non-forced inline in the kernel,
> and fixing the kernel should give a superset of the space savings of
> this "inline optimization".

Here's a good counterexample: kernel/mutex.c.

__mutex_lock_common wants to be inlined into __mutex_lock_*_slowpath.
and *_slowpath *shouldn't* be inlined into mutex_lock_*.

--
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."
--
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/