* Re: [PATCH] add Kconfig option for optimizing for cell
2007-09-15 0:21 [PATCH] add Kconfig option for optimizing for cell Arnd Bergmann
@ 2007-09-14 23:07 ` Josh Boyer
2007-09-15 1:02 ` Arnd Bergmann
2007-09-15 0:50 ` Segher Boessenkool
2007-09-15 13:13 ` David Woodhouse
2 siblings, 1 reply; 8+ messages in thread
From: Josh Boyer @ 2007-09-14 23:07 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: linuxppc-dev
On Sat, 2007-09-15 at 02:21 +0200, Arnd Bergmann wrote:
> Since the PPE on cell is an in-order core, it suffers significantly
> from wrong instruction scheduling. This adds an Kconfig option that
> enables passing -mtune=cell to gcc in order to generate object
> code that runs well on cell.
Which version of gcc supports that?
josh
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] add Kconfig option for optimizing for cell
2007-09-15 1:02 ` Arnd Bergmann
@ 2007-09-14 23:36 ` Josh Boyer
0 siblings, 0 replies; 8+ messages in thread
From: Josh Boyer @ 2007-09-14 23:36 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: linuxppc-dev
On Sat, 2007-09-15 at 03:02 +0200, Arnd Bergmann wrote:
> On Saturday 15 September 2007, Josh Boyer wrote:
> > On Sat, 2007-09-15 at 02:21 +0200, Arnd Bergmann wrote:
> > > Since the PPE on cell is an in-order core, it suffers significantly
> > > from wrong instruction scheduling. This adds an Kconfig option that
> > > enables passing -mtune=cell to gcc in order to generate object
> > > code that runs well on cell.
> >
> > Which version of gcc supports that?
> >
>
> gcc-4.3 will be the first official release that has everything in it,
> and I think 4.1 has some parts. However, there are many patched gcc
> versions in various distributions, so I tried to avoid being too
> specific about the version here.
>
> Of course, on gcc versions that don't support -mtune=cell, the
> Kconfig option does not make a difference.
Sure. I was just wondering if mentioning the first official GCC version
in the Kconfig description would help prevent users from selecting the
option for GCCs that don't support it and then being confused later when
nothing happens. Your call though.
josh
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] add Kconfig option for optimizing for cell
@ 2007-09-15 0:21 Arnd Bergmann
2007-09-14 23:07 ` Josh Boyer
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Arnd Bergmann @ 2007-09-15 0:21 UTC (permalink / raw)
To: linuxppc-dev
Since the PPE on cell is an in-order core, it suffers significantly
from wrong instruction scheduling. This adds an Kconfig option that
enables passing -mtune=cell to gcc in order to generate object
code that runs well on cell.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 6015a92..87aff53 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -92,6 +92,10 @@ else
endif
endif
+ifeq ($(CONFIG_TUNE_CELL),y)
+ CFLAGS += $(call cc-option,-mtune=cell)
+endif
+
# No AltiVec instruction when building kernel
CFLAGS += $(call cc-option,-mno-altivec)
diff --git a/arch/powerpc/platforms/Kconfig.cputype b/arch/powerpc/platforms/Kconfig.cputype
index 86eb4cf..4c315be 100644
--- a/arch/powerpc/platforms/Kconfig.cputype
+++ b/arch/powerpc/platforms/Kconfig.cputype
@@ -71,6 +71,18 @@ config POWER4
depends on PPC64
def_bool y
+config TUNE_CELL
+ bool "Optimize for Cell Broadband Engine"
+ depends on PPC64
+ help
+ Cause the compiler to optimize for the PPE of the Cell Broadband
+ Engine. This will make the code run considerably faster on Cell
+ but somewhat slower on other machines. This option only changes
+ the scheduling of instructions, not the selection of instructions
+ itself, so the resulting kernel will keep running on all other
+ machines. When building a kernel that is supposed to run only
+ on Cell, you should also select the POWER4_ONLY option.
+
config 6xx
bool
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] add Kconfig option for optimizing for cell
2007-09-15 0:21 [PATCH] add Kconfig option for optimizing for cell Arnd Bergmann
2007-09-14 23:07 ` Josh Boyer
@ 2007-09-15 0:50 ` Segher Boessenkool
2007-09-15 1:02 ` Arnd Bergmann
2007-09-15 13:13 ` David Woodhouse
2 siblings, 1 reply; 8+ messages in thread
From: Segher Boessenkool @ 2007-09-15 0:50 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: linuxppc-dev
> +config TUNE_CELL
> + bool "Optimize for Cell Broadband Engine"
> + depends on PPC64
> + help
> + Cause the compiler to optimize for the PPE of the Cell Broadband
> + Engine. This will make the code run considerably faster on Cell
> + but somewhat slower on other machines. This option only changes
> + the scheduling of instructions, not the selection of instructions
> + itself,
It _does_ change instruction selection, which is the main factor
in the slowdown on other machines (and a big part of the speedup
on Cell, too). It doesn't change which insns the compiler is
allowed to use though, which is probably what you wanted to say?
Segher
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] add Kconfig option for optimizing for cell
2007-09-14 23:07 ` Josh Boyer
@ 2007-09-15 1:02 ` Arnd Bergmann
2007-09-14 23:36 ` Josh Boyer
0 siblings, 1 reply; 8+ messages in thread
From: Arnd Bergmann @ 2007-09-15 1:02 UTC (permalink / raw)
To: Josh Boyer; +Cc: linuxppc-dev
On Saturday 15 September 2007, Josh Boyer wrote:
> On Sat, 2007-09-15 at 02:21 +0200, Arnd Bergmann wrote:
> > Since the PPE on cell is an in-order core, it suffers significantly
> > from wrong instruction scheduling. This adds an Kconfig option that
> > enables passing -mtune=cell to gcc in order to generate object
> > code that runs well on cell.
>
> Which version of gcc supports that?
>
gcc-4.3 will be the first official release that has everything in it,
and I think 4.1 has some parts. However, there are many patched gcc
versions in various distributions, so I tried to avoid being too
specific about the version here.
Of course, on gcc versions that don't support -mtune=cell, the
Kconfig option does not make a difference.
Arnd <><
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] add Kconfig option for optimizing for cell
2007-09-15 0:50 ` Segher Boessenkool
@ 2007-09-15 1:02 ` Arnd Bergmann
0 siblings, 0 replies; 8+ messages in thread
From: Arnd Bergmann @ 2007-09-15 1:02 UTC (permalink / raw)
To: linuxppc-dev
On Saturday 15 September 2007, Segher Boessenkool wrote:
>=20
> > +config TUNE_CELL
> > +=A0=A0=A0=A0=A0bool "Optimize for Cell Broadband Engine"
> > +=A0=A0=A0=A0=A0depends on PPC64
> > +=A0=A0=A0=A0=A0help
> > +=A0=A0=A0=A0=A0 =A0Cause the compiler to optimize for the PPE of the C=
ell Broadband
> > +=A0=A0=A0=A0=A0 =A0Engine. This will make the code run considerably fa=
ster on Cell
> > +=A0=A0=A0=A0=A0 =A0but somewhat slower on other machines. This option =
only changes
> > +=A0=A0=A0=A0=A0 =A0the scheduling of instructions, not the selection o=
f instructions
> > +=A0=A0=A0=A0=A0 =A0itself,
>=20
> It _does_ change instruction selection, which is the main factor
> in the slowdown on other machines (and a big part of the speedup
> on Cell, too). =A0It doesn't change which insns the compiler is
> allowed to use though, which is probably what you wanted to say?
Right, thanks for the correction.
Arnd <><
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] add Kconfig option for optimizing for cell
2007-09-15 0:21 [PATCH] add Kconfig option for optimizing for cell Arnd Bergmann
2007-09-14 23:07 ` Josh Boyer
2007-09-15 0:50 ` Segher Boessenkool
@ 2007-09-15 13:13 ` David Woodhouse
2007-09-15 13:30 ` Arnd Bergmann
2 siblings, 1 reply; 8+ messages in thread
From: David Woodhouse @ 2007-09-15 13:13 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: linuxppc-dev
On Sat, 2007-09-15 at 02:21 +0200, Arnd Bergmann wrote:
> Since the PPE on cell is an in-order core, it suffers significantly
> from wrong instruction scheduling. This adds an Kconfig option that
> enables passing -mtune=cell to gcc in order to generate object
> code that runs well on cell.
Do we have an option which is useful for a multiplatform kernel (and for
userspace) and which lies between the two extremes? Something which will
improve performance on Cell (and POWER6?) without sucking too hard
elsewhere?
--
dwmw2
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] add Kconfig option for optimizing for cell
2007-09-15 13:13 ` David Woodhouse
@ 2007-09-15 13:30 ` Arnd Bergmann
0 siblings, 0 replies; 8+ messages in thread
From: Arnd Bergmann @ 2007-09-15 13:30 UTC (permalink / raw)
To: David Woodhouse; +Cc: linuxppc-dev
On Saturday 15 September 2007, David Woodhouse wrote:
> On Sat, 2007-09-15 at 02:21 +0200, Arnd Bergmann wrote:
> > Since the PPE on cell is an in-order core, it suffers significantly
> > from wrong instruction scheduling. This adds an Kconfig option that
> > enables passing -mtune=cell to gcc in order to generate object
> > code that runs well on cell.
>
> Do we have an option which is useful for a multiplatform kernel (and for
> userspace) and which lies between the two extremes? Something which will
> improve performance on Cell (and POWER6?) without sucking too hard
> elsewhere?
No, not really. The impact of -mtune=cell should not be too bad on other
out-of-order CPUs, but we don't have any good measurements to back that
up, and it may also be really bad for POWER6 and other in-order cores.
Arnd <><
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2007-09-15 13:34 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-15 0:21 [PATCH] add Kconfig option for optimizing for cell Arnd Bergmann
2007-09-14 23:07 ` Josh Boyer
2007-09-15 1:02 ` Arnd Bergmann
2007-09-14 23:36 ` Josh Boyer
2007-09-15 0:50 ` Segher Boessenkool
2007-09-15 1:02 ` Arnd Bergmann
2007-09-15 13:13 ` David Woodhouse
2007-09-15 13:30 ` Arnd Bergmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox