linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Artem S. Tashkinov" <aros@gmx.com>
To: Jason@zx2c4.com
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] Kconfig: default to CC_OPTIMIZE_FOR_PERFORMANCE_O3 for gcc >= 10
Date: Wed, 13 May 2020 16:27:38 +0500	[thread overview]
Message-ID: <2e80bcf3-d744-3869-2f74-5c1799761ead@gmx.com> (raw)
In-Reply-To: <20200507224530.2993316-1-Jason@zx2c4.com>

 > GCC 10 appears to have changed -O2 in order to make compilation time
faster when using -flto, seemingly at the expense of performance, in
particular with regards to how the inliner works. Since -O3 these days
shouldn't have the same set of bugs as 10 years ago, this commit
defaults new kernel compiles to -O3 when using gcc >= 10.

It's a strong "no" from me.

1) Aside from rare Gentoo users no one has extensively tested -O3 with
the kernel - even Gentoo defaults to -O2 for kernel compilation

2) -O3 _always_ bloats the code by a large amount which means both
vmlinux/bzImage and modules will become bigger, and slower to load from
the disk

3) -O3 does _not_ necessarily makes the code run faster

4) If GCC10 has removed certain options for the -O2 optimization level
you could just readded them as compilation flags without forcing -O3 by
default on everyone

5) If you still insist on -O3 I guess everyone would be happy if you
just made two KConfig options:

OPTIMIZE_O2 (-O2)
OPTIMIZE_O3_EVEN_MOAR (-O3)

Best regards,
Artem

      parent reply	other threads:[~2020-05-13 11:27 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-07 22:45 Jason A. Donenfeld
2020-05-08  8:35 ` Peter Zijlstra
2020-05-08  9:02 ` Oleksandr Natalenko
2020-05-08 11:21   ` Jason A. Donenfeld
2020-05-08 11:33     ` Oleksandr Natalenko
2020-05-08 11:49       ` Arnd Bergmann
2020-05-08 12:07         ` Jason A. Donenfeld
2020-05-08 13:04           ` Arnd Bergmann
2020-05-08 15:06         ` Joe Perches
2020-05-08 15:09           ` Arnd Bergmann
2020-05-10 12:47           ` David Laight
2020-05-10 17:45             ` Joe Perches
2020-05-10 18:58               ` David Laight
2020-05-12  1:10             ` Masahiro Yamada
2020-05-11 21:57   ` [PATCH v2] " Jason A. Donenfeld
2020-05-12  0:04     ` Linus Torvalds
2020-05-12  0:09       ` Linus Torvalds
2020-05-12  0:43       ` Jason A. Donenfeld
2020-05-12  8:44       ` Richard Biener
2020-05-13 11:27 ` Artem S. Tashkinov [this message]

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=2e80bcf3-d744-3869-2f74-5c1799761ead@gmx.com \
    --to=aros@gmx.com \
    --cc=Jason@zx2c4.com \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH] Kconfig: default to CC_OPTIMIZE_FOR_PERFORMANCE_O3 for gcc >= 10' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).