From: Arjan van de Ven <arjan@infradead.org>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: mingo@elte.hu, akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [patch 7/7] Make "inline" no longer mandatory for gcc 4.x
Date: Fri, 06 Jan 2006 20:35:59 +0100 [thread overview]
Message-ID: <1136576160.2940.76.camel@laptopd505.fenrus.org> (raw)
In-Reply-To: <43BEA970.4050704@pobox.com>
On Fri, 2006-01-06 at 12:31 -0500, Jeff Garzik wrote:
> Arjan van de Ven wrote:
> > Subject: when CONFIG_CC_OPTIMIZE_FOR_SIZE, allow gcc4 to control inlining
> > From: Ingo Molnar <mingo@elte.hu>
> >
> > 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.
> > This is probably the most flame-worthy patch of the series.
> >
> > Signed-off-by: Ingo Molnar <mingo@elte.hu>
> > Signed-off-by: Arjan van de Ven <arjan@infradead.org>
>
> NAK, for what it's worth... This should be first integrated with its
> own "off switch", and then later added to optimze-for-size.
at the same time I'd not want such a config option to linger around
forever; if we do one config option per patch it gets unmanagable.
How about this?
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: Arjan van de Ven <arjan@infradead.org>
----
include/linux/compiler-gcc4.h | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
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
@@ -3,9 +3,11 @@
/* These definitions are for GCC v4.x. */
#include <linux/compiler-gcc.h>
-#define inline inline __attribute__((always_inline))
-#define __inline__ __inline__ __attribute__((always_inline))
-#define __inline __inline __attribute__((always_inline))
+#ifdef CONFIG_FORCED_INLINING
+# define inline inline __attribute__((always_inline))
+# define __inline__ __inline__ __attribute__((always_inline))
+# define __inline __inline __attribute__((always_inline))
+#endif
#define __always_inline inline __attribute__((always_inline))
#define __deprecated __attribute__((deprecated))
#define __attribute_used__ __attribute__((__used__))
Index: linux-2.6.15/lib/Kconfig.debug
===================================================================
--- linux-2.6.15.orig/lib/Kconfig.debug
+++ linux-2.6.15/lib/Kconfig.debug
@@ -186,6 +186,20 @@ config FRAME_POINTER
some architectures or if you use external debuggers.
If you don't debug the kernel, you can say N.
+config FORCED_INLINING
+ bool "Force gcc to inline functions marked 'inline'"
+ depends on DEBUG_KERNEL
+ default y
+ help
+ This option determines if the kernel forces gcc to inline the functions
+ developers have marked 'inline'. Doing so takes away freedom from gcc to
+ do what it thinks is best, which is desirable for the gcc 3.x series of
+ compilers. The gcc 4.x series have a rewritten inlining algorithm and
+ disabling this option will generate a smaller kernel there. Hopefully
+ this algorithm is so good that allowing gcc4 to make the decision can
+ become the default in the future, until then this option is there to
+ test gcc for this.
+
config RCU_TORTURE_TEST
tristate "torture tests for RCU"
depends on DEBUG_KERNEL
Index: linux-2.6.15/Documentation/feature-removal-schedule.txt
===================================================================
--- linux-2.6.15.orig/Documentation/feature-removal-schedule.txt
+++ linux-2.6.15/Documentation/feature-removal-schedule.txt
@@ -143,6 +143,15 @@ Who: Christoph Hellwig <hch@lst.de>
---------------------------
+What: CONFIG_FORCED_INLINING
+When: June 2006
+Why: Config option is there to see if gcc is good enough. (in january
+ 2006). If it is, the behavior should just be the default. If it's not,
+ the option should just go away entirely.
+Who: Arjan van de Ven <arjan@infradead.org>
+
+---------------------------
+
What: START_ARRAY ioctl for md
When: July 2006
Files: drivers/md/md.c
next prev parent reply other threads:[~2006-01-06 19:36 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-06 10:37 [patch 1/7] Make __always_inline actually force always inlining Arjan van de Ven
2006-01-06 10:38 ` [patch 2/7] enable unit-at-a-time optimisations for gcc4 Arjan van de Ven
2006-01-06 17:18 ` Jeff Garzik
2006-01-06 18:48 ` Sam Ravnborg
2006-01-06 19:00 ` Arjan van de Ven
2006-01-06 19:02 ` Jeff Garzik
2006-01-06 23:56 ` Sam Ravnborg
2006-01-07 0:05 ` Andi Kleen
2006-01-07 0:20 ` Matt Mackall
2006-01-07 1:11 ` Andi Kleen
2006-01-07 8:47 ` Sam Ravnborg
2006-01-07 9:07 ` Andrew Morton
2006-01-07 10:03 ` Sam Ravnborg
2006-01-07 10:13 ` Andrew Morton
2006-01-07 12:00 ` Sam Ravnborg
2006-01-06 10:39 ` [patch 3/7] mark several functions __always_inline Arjan van de Ven
2006-01-06 10:41 ` [patch 4/7] Mark some key VFS functions as __always_inline Arjan van de Ven
2006-01-06 10:50 ` Al Viro
2006-01-06 10:42 ` [patch 5/7] uninline capable() Arjan van de Ven
2006-01-06 11:18 ` Michael Buesch
2006-01-06 11:22 ` Arjan van de Ven
2006-01-06 11:26 ` Michael Buesch
2006-01-08 5:51 ` [PATCH 1/4] move capable() to capability.h Randy.Dunlap
2006-01-08 7:45 ` Valdis.Kletnieks
2006-01-08 13:48 ` Randy.Dunlap
2006-01-08 18:02 ` Tim Schmielau
2006-01-09 1:55 ` Randy.Dunlap
2006-01-08 18:15 ` Tim Schmielau
2006-01-08 19:03 ` Andrew Morton
2006-01-08 17:19 ` [patch 5/7] uninline capable() Tim Schmielau
2006-01-07 0:28 ` Matt Mackall
2006-01-06 10:43 ` [patch 6/7] Unlinline a bunch of other functions Arjan van de Ven
2006-01-06 12:11 ` [PATCH] pktcdvd: Un-inline some functions Peter Osterlund
2006-01-06 17:29 ` [patch 6/7] Unlinline a bunch of other functions Jeff Garzik
2006-01-07 6:28 ` Andrew Morton
2006-01-06 10:45 ` [patch 7/7] Make "inline" no longer mandatory for gcc 4.x Arjan van de Ven
2006-01-06 17:31 ` Jeff Garzik
2006-01-06 19:35 ` Arjan van de Ven [this message]
2006-01-07 6:33 ` Andrew Morton
2006-01-07 8:34 ` Arjan van de Ven
2006-01-07 19:05 ` Kurt Wall
2006-01-07 19:10 ` Arjan van de Ven
2006-01-07 19:44 ` Arjan van de Ven
2006-01-07 22:13 ` Kurt Wall
2006-01-08 3:16 ` Kurt Wall
2006-01-08 3:56 ` Mitchell Blank Jr
2006-01-08 7:14 ` Kurt Wall
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1136576160.2940.76.camel@laptopd505.fenrus.org \
--to=arjan@infradead.org \
--cc=akpm@osdl.org \
--cc=jgarzik@pobox.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®