All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Add option to build with -O3
@ 2014-03-05  0:01 Jon Ringle
  2014-03-05  5:09 ` Greg KH
  0 siblings, 1 reply; 16+ messages in thread
From: Jon Ringle @ 2014-03-05  0:01 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jon Ringle

Signed-off-by: Jon Ringle <jringle@gridpoint.com>
---
 Makefile     |  2 ++
 init/Kconfig | 19 ++++++++++++++++---
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 78209ee..e7f0b3c 100644
--- a/Makefile
+++ b/Makefile
@@ -581,6 +581,8 @@ all: vmlinux

 ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
 KBUILD_CFLAGS  += -Os $(call cc-disable-warning,maybe-uninitialized,)
+else ifdef CONFIG_CC_OPTIMIZE_FOR_SPEED
+KBUILD_CFLAGS   += -O3
 else
 KBUILD_CFLAGS  += -O2
 endif
diff --git a/init/Kconfig b/init/Kconfig
index 009a797..17d4c62 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1233,13 +1233,26 @@ source "usr/Kconfig"

 endif

+choice
+    prompt "Optimize"
+
+config CC_OPTIMIZE_NORMAL
+    bool "Optimize Normal (-O2)"
+    help
+      Enabling this option will pass "-O2" to gcc
 config CC_OPTIMIZE_FOR_SIZE
-       bool "Optimize for size"
+       bool "Optimize for size (-Os)"
        help
-         Enabling this option will pass "-Os" instead of "-O2" to gcc
+         Enabling this option will pass "-Os" to gcc
          resulting in a smaller kernel.

-         If unsure, say N.
+config CC_OPTIMIZE_FOR_SPEED
+    bool "Optimze for speed (-O3)"
+    help
+      Enabling this option will pass "-O3" to gcc
+      resulting in a larger kernel (but possibly faster)
+
+endchoice

 config SYSCTL
        bool
--
1.8.5.4


The information contained in this transmission may contain confidential information.  If the reader of this message is not the intended recipient, you are hereby notified that any review, dissemination, distribution or duplication of this communication is strictly prohibited.  If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.

^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH] Add option to build with -O3
  2014-03-05  0:01 [PATCH] Add option to build with -O3 Jon Ringle
@ 2014-03-05  5:09 ` Greg KH
  2014-03-05  5:37   ` Jon Ringle
  2014-03-05  7:32   ` Jon Ringle
  0 siblings, 2 replies; 16+ messages in thread
From: Greg KH @ 2014-03-05  5:09 UTC (permalink / raw)
  To: Jon Ringle; +Cc: linux-kernel

On Tue, Mar 04, 2014 at 07:01:49PM -0500, Jon Ringle wrote:
> +config CC_OPTIMIZE_FOR_SPEED
> +    bool "Optimze for speed (-O3)"
> +    help
> +      Enabling this option will pass "-O3" to gcc
> +      resulting in a larger kernel (but possibly faster)

Are you sure about that?  Have you measured it?


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] Add option to build with -O3
  2014-03-05  5:09 ` Greg KH
@ 2014-03-05  5:37   ` Jon Ringle
  2014-03-05  6:08     ` Greg KH
  2014-03-06 13:28     ` Richard Weinberger
  2014-03-05  7:32   ` Jon Ringle
  1 sibling, 2 replies; 16+ messages in thread
From: Jon Ringle @ 2014-03-05  5:37 UTC (permalink / raw)
  To: Greg KH; +Cc: Ringle, Jonathan, linux-kernel



On Wed, 5 Mar 2014, Greg KH wrote:

> On Tue, Mar 04, 2014 at 07:01:49PM -0500, Jon Ringle wrote:
> > +config CC_OPTIMIZE_FOR_SPEED
> > +    bool "Optimze for speed (-O3)"
> > +    help
> > +      Enabling this option will pass "-O3" to gcc
> > +      resulting in a larger kernel (but possibly faster)
>
> Are you sure about that?  Have you measured it?

I do know that there is an improvement performance-wise for my particular
use-case.

My target is an ARM board being built with gcc-4.8.2. My board has on it a
sc16is740 that is used as an RS-485 port. The sc16is740 is on the i2c bus,
so when an interrupt comes in to indicate that there is data available to
be read, I need to get the data over the i2c bus. I do this on a kthread
to do this work. The i2c transactions (using i2c-davinci driver) are also
interrupt driven. I was seeing a lot of lost packets when receiving data
at only 19200. Adding the -O3 compile option helped in this regard in that
I am now rarely seeing packet loss.

Jon

The information contained in this transmission may contain confidential information.  If the reader of this message is not the intended recipient, you are hereby notified that any review, dissemination, distribution or duplication of this communication is strictly prohibited.  If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] Add option to build with -O3
  2014-03-05  5:37   ` Jon Ringle
@ 2014-03-05  6:08     ` Greg KH
  2014-03-05  6:19       ` Jon Ringle
  2014-03-06 13:28     ` Richard Weinberger
  1 sibling, 1 reply; 16+ messages in thread
From: Greg KH @ 2014-03-05  6:08 UTC (permalink / raw)
  To: Jon Ringle; +Cc: Ringle, Jonathan, linux-kernel

On Wed, Mar 05, 2014 at 12:37:56AM -0500, Jon Ringle wrote:
> The information contained in this transmission may contain confidential information.  If the reader of this message is not the intended recipient, you are hereby notified that any review, dissemination, distribution or duplication of this communication is strictly prohibited.  If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.

Because of this footer, I must destroy this message, kernel development
is not confidental.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] Add option to build with -O3
  2014-03-05  6:08     ` Greg KH
@ 2014-03-05  6:19       ` Jon Ringle
  2014-03-05  6:31         ` Greg KH
  2014-03-05 18:14         ` Valdis.Kletnieks
  0 siblings, 2 replies; 16+ messages in thread
From: Jon Ringle @ 2014-03-05  6:19 UTC (permalink / raw)
  To: Greg KH; +Cc: Ringle, Jonathan, linux-kernel



On Wed, 5 Mar 2014, Greg KH wrote:

> On Wed, Mar 05, 2014 at 12:37:56AM -0500, Jon Ringle wrote:
> > The information contained in this transmission may contain confidential information.  If the reader of this message is not the intended recipient, you are hereby notified that any review, dissemination, distribution or duplication of this communication is strictly prohibited.  If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
>
> Because of this footer, I must destroy this message, kernel development
> is not confidental.
>

Obviously, this is a footer that is not added by me, but rather the mail
server I am sending this message through. Besides, the footer indates it
"may contain confidential information". The key word being *may*. Of
course kernel development is never confidential and the content of any
transmission done to the lkml is of public record. You and anyone who
cares to read/comment this message on lkml is indeed the inteded
recipient, therefore there is no need to destroy this message :)

I sure hope your response was just in jest :)

Jon

The information contained in this transmission may contain confidential information.  If the reader of this message is not the intended recipient, you are hereby notified that any review, dissemination, distribution or duplication of this communication is strictly prohibited.  If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] Add option to build with -O3
  2014-03-05  6:19       ` Jon Ringle
@ 2014-03-05  6:31         ` Greg KH
  2014-03-05 18:14         ` Valdis.Kletnieks
  1 sibling, 0 replies; 16+ messages in thread
From: Greg KH @ 2014-03-05  6:31 UTC (permalink / raw)
  To: Jon Ringle; +Cc: Ringle, Jonathan, linux-kernel

On Wed, Mar 05, 2014 at 01:19:17AM -0500, Jon Ringle wrote:
> 
> 
> On Wed, 5 Mar 2014, Greg KH wrote:
> 
> > On Wed, Mar 05, 2014 at 12:37:56AM -0500, Jon Ringle wrote:
> > > The information contained in this transmission may contain confidential information.  If the reader of this message is not the intended recipient, you are hereby notified that any review, dissemination, distribution or duplication of this communication is strictly prohibited.  If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
> >
> > Because of this footer, I must destroy this message, kernel development
> > is not confidental.
> >
> 
> Obviously, this is a footer that is not added by me, but rather the mail
> server I am sending this message through. Besides, the footer indates it
> "may contain confidential information". The key word being *may*. Of
> course kernel development is never confidential and the content of any
> transmission done to the lkml is of public record. You and anyone who
> cares to read/comment this message on lkml is indeed the inteded
> recipient, therefore there is no need to destroy this message :)

But how do I know for sure that there isn't anything confidential in it?

> I sure hope your response was just in jest :)

Sadly, no, I have been advised that I am not supposed to respond to
messages with footers like that, and I am not allowed to take patches
with them either.

Now, I'm ignoring the first part (responding) to help you learn why your
patches will proabably always be ignored, please work to remove that
from your email server.

good luck,

greg k-h

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] Add option to build with -O3
  2014-03-05  5:09 ` Greg KH
  2014-03-05  5:37   ` Jon Ringle
@ 2014-03-05  7:32   ` Jon Ringle
  2014-03-06  4:43     ` Greg KH
  1 sibling, 1 reply; 16+ messages in thread
From: Jon Ringle @ 2014-03-05  7:32 UTC (permalink / raw)
  To: Greg KH; +Cc: Ringle, Jonathan, linux-kernel

On Wed, 5 Mar 2014, Greg KH wrote:

> On Tue, Mar 04, 2014 at 07:01:49PM -0500, Jon Ringle wrote:
> > +config CC_OPTIMIZE_FOR_SPEED
> > +    bool "Optimze for speed (-O3)"
> > +    help
> > +      Enabling this option will pass "-O3" to gcc
> > +      resulting in a larger kernel (but possibly faster)
> 
> Are you sure about that?  Have you measured it?

(Resending this message, since it was "destroyed". Hopefully, this is now 
an an acceptable form :)

I do know that there is an improvement performance-wise for my particular 
use-case.

My target is an ARM board being built with gcc-4.8.2. My board has on it a 
sc16is740 that is used as an RS-485 port. The sc16is740 is on the i2c bus, 
so when an interrupt comes in to indicate that there is data available to 
be read, I need to get the data over the i2c bus. I do this on a kthread 
to do this work. The i2c transactions (using i2c-davinci driver) are also 
interrupt driven. I was seeing a lot of lost packets when receiving data 
at only 19200. Adding the -O3 compile option helped in this regard in that 
I am now rarely seeing packet loss.

Jon
 

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] Add option to build with -O3
  2014-03-05  6:19       ` Jon Ringle
  2014-03-05  6:31         ` Greg KH
@ 2014-03-05 18:14         ` Valdis.Kletnieks
  1 sibling, 0 replies; 16+ messages in thread
From: Valdis.Kletnieks @ 2014-03-05 18:14 UTC (permalink / raw)
  To: Jon Ringle; +Cc: Greg KH, Ringle, Jonathan, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 930 bytes --]

On Wed, 05 Mar 2014 01:19:17 -0500, Jon Ringle said:

>  If you are not the intended recipient, please contact the sender by reply
> email and destroy all copies of the original message.

Is your company willing to indemnify my organization for the costs of tracking
down *all* copies of the message (including, but not restricted to, those on
backup tapes, copies automatically committed to WORM-based compliance stores by
our mail system, and already logically deleted but not yet overwritten blocks
on disk), and securely clearing the data sufficient to prevent its recovery by
an experienced forensics analyst armed with a subpoena and a "preserve
evidence" order?

And does your company's clientele realize that in case of a miscue on
the part of one of your staff, you're relying on an unknown third party's
good will to secure their confidential information, instead of relying on
actual cryptography to secure their data?

[-- Attachment #2: Type: application/pgp-signature, Size: 848 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] Add option to build with -O3
  2014-03-05  7:32   ` Jon Ringle
@ 2014-03-06  4:43     ` Greg KH
  0 siblings, 0 replies; 16+ messages in thread
From: Greg KH @ 2014-03-06  4:43 UTC (permalink / raw)
  To: Jon Ringle; +Cc: Ringle, Jonathan, linux-kernel

On Wed, Mar 05, 2014 at 02:32:26AM -0500, Jon Ringle wrote:
> On Wed, 5 Mar 2014, Greg KH wrote:
> 
> > On Tue, Mar 04, 2014 at 07:01:49PM -0500, Jon Ringle wrote:
> > > +config CC_OPTIMIZE_FOR_SPEED
> > > +    bool "Optimze for speed (-O3)"
> > > +    help
> > > +      Enabling this option will pass "-O3" to gcc
> > > +      resulting in a larger kernel (but possibly faster)
> > 
> > Are you sure about that?  Have you measured it?
> 
> (Resending this message, since it was "destroyed". Hopefully, this is now 
> an an acceptable form :)
> 
> I do know that there is an improvement performance-wise for my particular 
> use-case.
> 
> My target is an ARM board being built with gcc-4.8.2. My board has on it a 
> sc16is740 that is used as an RS-485 port. The sc16is740 is on the i2c bus, 
> so when an interrupt comes in to indicate that there is data available to 
> be read, I need to get the data over the i2c bus. I do this on a kthread 
> to do this work. The i2c transactions (using i2c-davinci driver) are also 
> interrupt driven. I was seeing a lot of lost packets when receiving data 
> at only 19200. Adding the -O3 compile option helped in this regard in that 
> I am now rarely seeing packet loss.

I'd take this up with the linux-arm developers, that sounds like
something is wrong with your system that a compiler change fixes
problems.  Something else must be wrong...

good luck,

greg k-h

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] Add option to build with -O3
  2014-03-05  5:37   ` Jon Ringle
  2014-03-05  6:08     ` Greg KH
@ 2014-03-06 13:28     ` Richard Weinberger
  2014-03-07 12:39       ` Austin S Hemmelgarn
  1 sibling, 1 reply; 16+ messages in thread
From: Richard Weinberger @ 2014-03-06 13:28 UTC (permalink / raw)
  To: Jon Ringle; +Cc: Greg KH, Ringle, Jonathan, linux-kernel

On Wed, Mar 5, 2014 at 6:37 AM, Jon Ringle <jringle@gridpoint.com> wrote:
>
>
> On Wed, 5 Mar 2014, Greg KH wrote:
>
>> On Tue, Mar 04, 2014 at 07:01:49PM -0500, Jon Ringle wrote:
>> > +config CC_OPTIMIZE_FOR_SPEED
>> > +    bool "Optimze for speed (-O3)"
>> > +    help
>> > +      Enabling this option will pass "-O3" to gcc
>> > +      resulting in a larger kernel (but possibly faster)
>>
>> Are you sure about that?  Have you measured it?
>
> I do know that there is an improvement performance-wise for my particular
> use-case.
>
> My target is an ARM board being built with gcc-4.8.2. My board has on it a
> sc16is740 that is used as an RS-485 port. The sc16is740 is on the i2c bus,
> so when an interrupt comes in to indicate that there is data available to
> be read, I need to get the data over the i2c bus. I do this on a kthread
> to do this work. The i2c transactions (using i2c-davinci driver) are also
> interrupt driven. I was seeing a lot of lost packets when receiving data
> at only 19200. Adding the -O3 compile option helped in this regard in that
> I am now rarely seeing packet loss.

Please also see:
http://www.gossamer-threads.com/lists/linux/kernel/1835761?do=post_view_threaded#1835761

-- 
Thanks,
//richard

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] Add option to build with -O3
  2014-03-06 13:28     ` Richard Weinberger
@ 2014-03-07 12:39       ` Austin S Hemmelgarn
  2014-03-07 12:42         ` Richard Weinberger
  0 siblings, 1 reply; 16+ messages in thread
From: Austin S Hemmelgarn @ 2014-03-07 12:39 UTC (permalink / raw)
  To: Richard Weinberger, Jon Ringle; +Cc: Greg KH, Ringle, Jonathan, linux-kernel

On 2014-03-06 08:28, Richard Weinberger wrote:
> On Wed, Mar 5, 2014 at 6:37 AM, Jon Ringle <jringle@gridpoint.com>
> wrote:
>> 
>> 
>> On Wed, 5 Mar 2014, Greg KH wrote:
>> 
>>> On Tue, Mar 04, 2014 at 07:01:49PM -0500, Jon Ringle wrote:
>>>> +config CC_OPTIMIZE_FOR_SPEED +    bool "Optimze for speed
>>>> (-O3)" +    help +      Enabling this option will pass "-O3"
>>>> to gcc +      resulting in a larger kernel (but possibly
>>>> faster)
>>> 
>>> Are you sure about that?  Have you measured it?
>> 
>> I do know that there is an improvement performance-wise for my
>> particular use-case.
>> 
>> My target is an ARM board being built with gcc-4.8.2. My board
>> has on it a sc16is740 that is used as an RS-485 port. The
>> sc16is740 is on the i2c bus, so when an interrupt comes in to
>> indicate that there is data available to be read, I need to get
>> the data over the i2c bus. I do this on a kthread to do this
>> work. The i2c transactions (using i2c-davinci driver) are also 
>> interrupt driven. I was seeing a lot of lost packets when
>> receiving data at only 19200. Adding the -O3 compile option
>> helped in this regard in that I am now rarely seeing packet
>> loss.
> 
> Please also see: 
> http://www.gossamer-threads.com/lists/linux/kernel/1835761?do=post_view_threaded#1835761
>
> 
Ironically, combining these might achieve a significant performance
improvement over CONFIG_GENERIC_CPU and -O2.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] Add option to build with -O3
  2014-03-07 12:39       ` Austin S Hemmelgarn
@ 2014-03-07 12:42         ` Richard Weinberger
  2014-03-07 12:51           ` Austin S Hemmelgarn
  0 siblings, 1 reply; 16+ messages in thread
From: Richard Weinberger @ 2014-03-07 12:42 UTC (permalink / raw)
  To: Austin S Hemmelgarn, Borislav Petkov, Jon Ringle
  Cc: Greg KH, Ringle, Jonathan, linux-kernel



Am 07.03.2014 13:39, schrieb Austin S Hemmelgarn:
> On 2014-03-06 08:28, Richard Weinberger wrote:
>> On Wed, Mar 5, 2014 at 6:37 AM, Jon Ringle <jringle@gridpoint.com>
>> wrote:
>>>
>>>
>>> On Wed, 5 Mar 2014, Greg KH wrote:
>>>
>>>> On Tue, Mar 04, 2014 at 07:01:49PM -0500, Jon Ringle wrote:
>>>>> +config CC_OPTIMIZE_FOR_SPEED +    bool "Optimze for speed
>>>>> (-O3)" +    help +      Enabling this option will pass "-O3"
>>>>> to gcc +      resulting in a larger kernel (but possibly
>>>>> faster)
>>>>
>>>> Are you sure about that?  Have you measured it?
>>>
>>> I do know that there is an improvement performance-wise for my
>>> particular use-case.
>>>
>>> My target is an ARM board being built with gcc-4.8.2. My board
>>> has on it a sc16is740 that is used as an RS-485 port. The
>>> sc16is740 is on the i2c bus, so when an interrupt comes in to
>>> indicate that there is data available to be read, I need to get
>>> the data over the i2c bus. I do this on a kthread to do this
>>> work. The i2c transactions (using i2c-davinci driver) are also 
>>> interrupt driven. I was seeing a lot of lost packets when
>>> receiving data at only 19200. Adding the -O3 compile option
>>> helped in this regard in that I am now rarely seeing packet
>>> loss.
>>
>> Please also see: 
>> http://www.gossamer-threads.com/lists/linux/kernel/1835761?do=post_view_threaded#1835761
>>
>>
> Ironically, combining these might achieve a significant performance
> improvement over CONFIG_GENERIC_CPU and -O2.

*might*
We still need a sane proof.

Thanks,
//richard

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] Add option to build with -O3
  2014-03-07 12:42         ` Richard Weinberger
@ 2014-03-07 12:51           ` Austin S Hemmelgarn
  2014-03-07 13:48             ` Borislav Petkov
  0 siblings, 1 reply; 16+ messages in thread
From: Austin S Hemmelgarn @ 2014-03-07 12:51 UTC (permalink / raw)
  To: Richard Weinberger, Borislav Petkov, Jon Ringle
  Cc: Greg KH, Ringle, Jonathan, linux-kernel

On 2014-03-07 07:42, Richard Weinberger wrote:
> 
> 
> Am 07.03.2014 13:39, schrieb Austin S Hemmelgarn:
>> On 2014-03-06 08:28, Richard Weinberger wrote:
>>> On Wed, Mar 5, 2014 at 6:37 AM, Jon Ringle <jringle@gridpoint.com>
>>> wrote:
>>>>
>>>>
>>>> On Wed, 5 Mar 2014, Greg KH wrote:
>>>>
>>>>> On Tue, Mar 04, 2014 at 07:01:49PM -0500, Jon Ringle wrote:
>>>>>> +config CC_OPTIMIZE_FOR_SPEED +    bool "Optimze for speed
>>>>>> (-O3)" +    help +      Enabling this option will pass "-O3"
>>>>>> to gcc +      resulting in a larger kernel (but possibly
>>>>>> faster)
>>>>>
>>>>> Are you sure about that?  Have you measured it?
>>>>
>>>> I do know that there is an improvement performance-wise for my
>>>> particular use-case.
>>>>
>>>> My target is an ARM board being built with gcc-4.8.2. My board
>>>> has on it a sc16is740 that is used as an RS-485 port. The
>>>> sc16is740 is on the i2c bus, so when an interrupt comes in to
>>>> indicate that there is data available to be read, I need to get
>>>> the data over the i2c bus. I do this on a kthread to do this
>>>> work. The i2c transactions (using i2c-davinci driver) are also 
>>>> interrupt driven. I was seeing a lot of lost packets when
>>>> receiving data at only 19200. Adding the -O3 compile option
>>>> helped in this regard in that I am now rarely seeing packet
>>>> loss.
>>>
>>> Please also see: 
>>> http://www.gossamer-threads.com/lists/linux/kernel/1835761?do=post_view_threaded#1835761
>>>
>>>
>> Ironically, combining these might achieve a significant performance
>> improvement over CONFIG_GENERIC_CPU and -O2.
> 
> *might*
> We still need a sane proof.
> 
> Thanks,
> //richard
> 
I'm not arguing that, I just don't have the time to test it at the
moment; and, "performance improvement" also can mean different things to
different people (a lot of RT folks for example don't care if things run
faster if it makes them much less deterministic).

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] Add option to build with -O3
  2014-03-07 12:51           ` Austin S Hemmelgarn
@ 2014-03-07 13:48             ` Borislav Petkov
  0 siblings, 0 replies; 16+ messages in thread
From: Borislav Petkov @ 2014-03-07 13:48 UTC (permalink / raw)
  To: Austin S Hemmelgarn
  Cc: Richard Weinberger, Jon Ringle, Greg KH, Ringle, Jonathan, linux-kernel

On Fri, Mar 07, 2014 at 07:51:56AM -0500, Austin S Hemmelgarn wrote:
> I'm not arguing that, I just don't have the time to test it at the
> moment; and, "performance improvement" also can mean different things
> to different people (a lot of RT folks for example don't care if
> things run faster if it makes them much less deterministic).

You people never seem to learn: numbers talk, bullshit walks. It is
*that* simple.

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH] Add option to build with -O3
  2014-03-05  7:36 jon
@ 2014-03-06 12:28 ` Austin S Hemmelgarn
  0 siblings, 0 replies; 16+ messages in thread
From: Austin S Hemmelgarn @ 2014-03-06 12:28 UTC (permalink / raw)
  To: jon, linux-kernel; +Cc: Jon Ringle

On 2014-03-05 02:36, jon@ringle.org wrote:
> From: Jon Ringle <jringle@gridpoint.com>
> 
> Signed-off-by: Jon Ringle <jringle@gridpoint.com>
> ---
>  Makefile     |  2 ++
>  init/Kconfig | 19 ++++++++++++++++---
>  2 files changed, 18 insertions(+), 3 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 78209ee..e7f0b3c 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -581,6 +581,8 @@ all: vmlinux
>  
>  ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
>  KBUILD_CFLAGS	+= -Os $(call cc-disable-warning,maybe-uninitialized,)
> +else ifdef CONFIG_CC_OPTIMIZE_FOR_SPEED
> +KBUILD_CFLAGS   += -O3
>  else
>  KBUILD_CFLAGS	+= -O2
>  endif
> diff --git a/init/Kconfig b/init/Kconfig
> index 009a797..17d4c62 100644
> --- a/init/Kconfig
> +++ b/init/Kconfig
> @@ -1233,13 +1233,26 @@ source "usr/Kconfig"
>  
>  endif
>  
> +choice
> +    prompt "Optimize"
> +
> +config CC_OPTIMIZE_NORMAL
> +    bool "Optimize Normal (-O2)"
> +    help
> +      Enabling this option will pass "-O2" to gcc
>  config CC_OPTIMIZE_FOR_SIZE
> -	bool "Optimize for size"
> +	bool "Optimize for size (-Os)"
>  	help
> -	  Enabling this option will pass "-Os" instead of "-O2" to gcc
> +	  Enabling this option will pass "-Os" to gcc
>  	  resulting in a smaller kernel.
>  
> -	  If unsure, say N.
> +config CC_OPTIMIZE_FOR_SPEED
> +    bool "Optimze for speed (-O3)"
> +    help
> +      Enabling this option will pass "-O3" to gcc
> +      resulting in a larger kernel (but possibly faster)
> +
> +endchoice
>  
>  config SYSCTL
>  	bool
> 
I would suggest putting a warning in the Kconfig text that this might
make things break in new and unusual ways (and possibly making it depend
on EXPERT).  All of the cases of -O3 breaking userspace software that I
have seen involve really edgy and complex (and often potentially
ambiguous) code, and while the core kernel doesn't have much of this,
there are a number drivers that do (The Synopsis DWC USB OTG driver
immediately comes to mind, as well as a number of drivers from staging).

^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH] Add option to build with -O3
@ 2014-03-05  7:36 jon
  2014-03-06 12:28 ` Austin S Hemmelgarn
  0 siblings, 1 reply; 16+ messages in thread
From: jon @ 2014-03-05  7:36 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jon Ringle

From: Jon Ringle <jringle@gridpoint.com>

Signed-off-by: Jon Ringle <jringle@gridpoint.com>
---
 Makefile     |  2 ++
 init/Kconfig | 19 ++++++++++++++++---
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 78209ee..e7f0b3c 100644
--- a/Makefile
+++ b/Makefile
@@ -581,6 +581,8 @@ all: vmlinux
 
 ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
 KBUILD_CFLAGS	+= -Os $(call cc-disable-warning,maybe-uninitialized,)
+else ifdef CONFIG_CC_OPTIMIZE_FOR_SPEED
+KBUILD_CFLAGS   += -O3
 else
 KBUILD_CFLAGS	+= -O2
 endif
diff --git a/init/Kconfig b/init/Kconfig
index 009a797..17d4c62 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1233,13 +1233,26 @@ source "usr/Kconfig"
 
 endif
 
+choice
+    prompt "Optimize"
+
+config CC_OPTIMIZE_NORMAL
+    bool "Optimize Normal (-O2)"
+    help
+      Enabling this option will pass "-O2" to gcc
 config CC_OPTIMIZE_FOR_SIZE
-	bool "Optimize for size"
+	bool "Optimize for size (-Os)"
 	help
-	  Enabling this option will pass "-Os" instead of "-O2" to gcc
+	  Enabling this option will pass "-Os" to gcc
 	  resulting in a smaller kernel.
 
-	  If unsure, say N.
+config CC_OPTIMIZE_FOR_SPEED
+    bool "Optimze for speed (-O3)"
+    help
+      Enabling this option will pass "-O3" to gcc
+      resulting in a larger kernel (but possibly faster)
+
+endchoice
 
 config SYSCTL
 	bool
-- 
1.8.5.4


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2014-03-07 13:49 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-05  0:01 [PATCH] Add option to build with -O3 Jon Ringle
2014-03-05  5:09 ` Greg KH
2014-03-05  5:37   ` Jon Ringle
2014-03-05  6:08     ` Greg KH
2014-03-05  6:19       ` Jon Ringle
2014-03-05  6:31         ` Greg KH
2014-03-05 18:14         ` Valdis.Kletnieks
2014-03-06 13:28     ` Richard Weinberger
2014-03-07 12:39       ` Austin S Hemmelgarn
2014-03-07 12:42         ` Richard Weinberger
2014-03-07 12:51           ` Austin S Hemmelgarn
2014-03-07 13:48             ` Borislav Petkov
2014-03-05  7:32   ` Jon Ringle
2014-03-06  4:43     ` Greg KH
2014-03-05  7:36 jon
2014-03-06 12:28 ` Austin S Hemmelgarn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.