From: Austin S Hemmelgarn <ahferroin7@gmail.com>
To: jon@ringle.org, linux-kernel@vger.kernel.org
Cc: Jon Ringle <jringle@gridpoint.com>
Subject: Re: [PATCH] Add option to build with -O3
Date: Thu, 06 Mar 2014 07:28:50 -0500 [thread overview]
Message-ID: <53186A02.6010203@gmail.com> (raw)
In-Reply-To: <1394004995-27963-1-git-send-email-jon@ringle.org>
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).
next prev parent reply other threads:[~2014-03-06 12:28 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-05 7:36 [PATCH] Add option to build with -O3 jon
2014-03-06 12:28 ` Austin S Hemmelgarn [this message]
-- strict thread matches above, loose matches on Subject: below --
2014-03-05 0:01 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
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=53186A02.6010203@gmail.com \
--to=ahferroin7@gmail.com \
--cc=jon@ringle.org \
--cc=jringle@gridpoint.com \
--cc=linux-kernel@vger.kernel.org \
/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