diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-01-14 16:21:33 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-14 21:27:16 -0500 |
commit | a9df3d0f312f4b1aefec76ae5ee86cccbf7cd4e0 (patch) | |
tree | fa0c3084c1c382c4187854286b2b217a99af039a | |
parent | ac893963030ad70e528dc23270d499d650546a38 (diff) |
[PATCH] When CONFIG_CC_OPTIMIZE_FOR_SIZE, allow gcc4 to control inlining
If optimizing for size (CONFIG_CC_OPTIMIZE_FOR_SIZE), allow gcc4 compilers
to decide what to inline and what not - instead of the kernel forcing gcc
to inline all the time. This requires several places that require to be
inlined to be marked as such, previous patches in this series do that.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | Documentation/feature-removal-schedule.txt | 9 | ||||
-rw-r--r-- | include/linux/compiler-gcc4.h | 9 | ||||
-rw-r--r-- | lib/Kconfig.debug | 14 |
3 files changed, 32 insertions, 0 deletions
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 9474501dd6cc..b4a1ea762698 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -123,6 +123,15 @@ Who: Christoph Hellwig <hch@lst.de> | |||
123 | 123 | ||
124 | --------------------------- | 124 | --------------------------- |
125 | 125 | ||
126 | What: CONFIG_FORCED_INLINING | ||
127 | When: June 2006 | ||
128 | Why: Config option is there to see if gcc is good enough. (in january | ||
129 | 2006). If it is, the behavior should just be the default. If it's not, | ||
130 | the option should just go away entirely. | ||
131 | Who: Arjan van de Ven | ||
132 | |||
133 | --------------------------- | ||
134 | |||
126 | What: START_ARRAY ioctl for md | 135 | What: START_ARRAY ioctl for md |
127 | When: July 2006 | 136 | When: July 2006 |
128 | Files: drivers/md/md.c | 137 | Files: drivers/md/md.c |
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h index 8249115a1f73..6f5cc6f0e7a6 100644 --- a/include/linux/compiler-gcc4.h +++ b/include/linux/compiler-gcc4.h | |||
@@ -3,6 +3,15 @@ | |||
3 | /* These definitions are for GCC v4.x. */ | 3 | /* These definitions are for GCC v4.x. */ |
4 | #include <linux/compiler-gcc.h> | 4 | #include <linux/compiler-gcc.h> |
5 | 5 | ||
6 | #ifdef CONFIG_FORCED_INLINING | ||
7 | # undef inline | ||
8 | # undef __inline__ | ||
9 | # undef __inline | ||
10 | # define inline inline __attribute__((always_inline)) | ||
11 | # define __inline__ __inline__ __attribute__((always_inline)) | ||
12 | # define __inline __inline __attribute__((always_inline)) | ||
13 | #endif | ||
14 | |||
6 | #define __attribute_used__ __attribute__((__used__)) | 15 | #define __attribute_used__ __attribute__((__used__)) |
7 | #define __must_check __attribute__((warn_unused_result)) | 16 | #define __must_check __attribute__((warn_unused_result)) |
8 | #define __compiler_offsetof(a,b) __builtin_offsetof(a,b) | 17 | #define __compiler_offsetof(a,b) __builtin_offsetof(a,b) |
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index a609235a517f..a314e663d517 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug | |||
@@ -195,6 +195,20 @@ config FRAME_POINTER | |||
195 | some architectures or if you use external debuggers. | 195 | some architectures or if you use external debuggers. |
196 | If you don't debug the kernel, you can say N. | 196 | If you don't debug the kernel, you can say N. |
197 | 197 | ||
198 | config FORCED_INLINING | ||
199 | bool "Force gcc to inline functions marked 'inline'" | ||
200 | depends on DEBUG_KERNEL | ||
201 | default y | ||
202 | help | ||
203 | This option determines if the kernel forces gcc to inline the functions | ||
204 | developers have marked 'inline'. Doing so takes away freedom from gcc to | ||
205 | do what it thinks is best, which is desirable for the gcc 3.x series of | ||
206 | compilers. The gcc 4.x series have a rewritten inlining algorithm and | ||
207 | disabling this option will generate a smaller kernel there. Hopefully | ||
208 | this algorithm is so good that allowing gcc4 to make the decision can | ||
209 | become the default in the future, until then this option is there to | ||
210 | test gcc for this. | ||
211 | |||
198 | config RCU_TORTURE_TEST | 212 | config RCU_TORTURE_TEST |
199 | tristate "torture tests for RCU" | 213 | tristate "torture tests for RCU" |
200 | depends on DEBUG_KERNEL | 214 | depends on DEBUG_KERNEL |