[patch 1/7] Make __always_inline actually force always inlining

From: Arjan van de Ven
Date: Fri Jan 06 2006 - 05:44:48 EST


From: Ingo Molnar <mingo@xxxxxxx>

This patch is the first in a series that tries to optimize the kernel in terms of size
(and thus cache behavior, both cpu and pagecache).

This first patch changes __always_inline to be a forced inline instead of
the "regular" inline it was on everything except alpha. This forced inline
matches the intention of the define better as a matter of documentation.
There is no change in behavior by this patch, since "inline" currently is
mapped to a forced inline anyway.

Signed-off-by: Ingo Molnar <mingo@xxxxxxx>
Signed-off-by: Arjan van de Ven <arjan@xxxxxxxxxxxxx>

===================================================================
--- linux-2.6.15.orig/include/linux/compiler-gcc3.h
+++ linux-2.6.15/include/linux/compiler-gcc3.h
@@ -9,6 +9,8 @@
# define __inline __inline __attribute__((always_inline))
#endif

+#define __always_inline inline __attribute__((always_inline))
+
#if __GNUC_MINOR__ > 0
# define __deprecated __attribute__((deprecated))
#endif
Index: linux-2.6.15/include/linux/compiler-gcc4.h
===================================================================
--- linux-2.6.15.orig/include/linux/compiler-gcc4.h
+++ linux-2.6.15/include/linux/compiler-gcc4.h
@@ -6,6 +6,7 @@
#define inline inline __attribute__((always_inline))
#define __inline__ __inline__ __attribute__((always_inline))
#define __inline __inline __attribute__((always_inline))
+#define __always_inline inline __attribute__((always_inline))
#define __deprecated __attribute__((deprecated))
#define __attribute_used__ __attribute__((__used__))
#define __attribute_pure__ __attribute__((pure))


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