From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>,
Claudiu Zissulescu <Claudiu.Zissulescu@synopsys.com>
Cc: Michal Marek <mmarek@suse.cz>,
"linux-arch@vger.kernel.org" <linux-arch@vger.kernel.org>,
lkml <linux-kernel@vger.kernel.org>
Subject: Re: subtle side effect of commit a1c48bb160f836
Date: Thu, 18 Jun 2015 14:46:33 +0530 [thread overview]
Message-ID: <55828C71.5060800@synopsys.com> (raw)
In-Reply-To: <CAMuHMdWZuz+x=A6h5Nt9DXAdf6x=MWg=su3smWoZd3GmOJxXKA@mail.gmail.com>
+CC Claudiu - ARC gcc guru
On Thursday 18 June 2015 02:25 PM, Geert Uytterhoeven wrote:
> Hi Vineet,
>
> On Thu, Jun 18, 2015 at 10:45 AM, Vineet Gupta
> <Vineet.Gupta1@synopsys.com> wrote:
>> On Thursday 18 June 2015 01:43 PM, Michal Marek wrote:
>>>>> Alternatively, as we already have CONFIG_CC_OPTIMIZE_FOR_SIZE,
>>>>> a(nother) Kconfig option may make sense.
>>> We can also introduce some ARCH_CFLAGS that is appended near the end of
>>> the list, and have arc/Makefile add its -O3 there. But I'd like to why
>>> the -O3 needs to be there in first place.
>>
>> This is how historically ARC kernels have been built. We do track performance
>> results LMBench/hackbench... and going from -O3 to -O2 caused a sudden dip in some
>> of the numbers when we measured 3.18 (vs. 3.13)
>>
>>> Obviously, the kernel works
>>> with -O2, otherwise the regression would have been identified earlier.
>>
>> Its a performance thing - so yeah -O2 works, but -O3 works even better :-)
>
> Did you see some numbers increase when going from -O3 to -O2?
> IIRC, -O3 enables more aggressive inlining, which can cause more L1 cache
> misses.
It sure does but smaller functions could cause more stack return mispredicts etc.
It all boils down to the micro-arch in the end and how gcc does arch specific
things under the hood of -O{2,s}.
> It might be worth trying CONFIG_CC_OPTIMIZE_FOR_SIZE=y...
Not for ARC. At -Os gcc is more worried about using short instructions (2 bytes),
and things like alignment of target branches, ld/st scheduling might not be as
optim as with -O2/O3. Some of the code density instructions have associated
pipeline stalls etc.
So last time (it's been a while though) when I ran benchmarks with -Os on ARC, it
was way off vs. -O2.
next prev parent reply other threads:[~2015-06-18 9:17 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-18 6:47 subtle side effect of commit a1c48bb160f836 Vineet Gupta
2015-06-18 7:10 ` Geert Uytterhoeven
2015-06-18 7:33 ` Vineet Gupta
2015-06-18 7:37 ` Geert Uytterhoeven
2015-06-18 8:00 ` Vineet Gupta
2015-06-18 8:13 ` Michal Marek
2015-06-18 8:45 ` Vineet Gupta
2015-06-18 8:45 ` Vineet Gupta
2015-06-18 8:45 ` Vineet Gupta
2015-06-18 8:55 ` Geert Uytterhoeven
2015-06-18 9:16 ` Vineet Gupta [this message]
2015-06-18 10:14 ` Michal Marek
2015-06-18 10:32 ` Vineet Gupta
2015-06-24 12:20 ` Vineet Gupta
2015-07-01 15:19 ` Michal Marek
2015-07-01 15:19 ` Michal Marek
2015-07-01 15:19 ` Michal Marek
2015-07-02 5:27 ` ARC build -O3 (was Re: subtle side effect of commit a1c48bb160f836) Vineet Gupta
2015-07-02 5:27 ` Vineet Gupta
2015-07-02 5:27 ` Vineet Gupta
2015-07-02 19:50 ` Michal Marek
2015-07-03 2:58 ` Vineet Gupta
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=55828C71.5060800@synopsys.com \
--to=vineet.gupta1@synopsys.com \
--cc=Claudiu.Zissulescu@synopsys.com \
--cc=geert@linux-m68k.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mmarek@suse.cz \
/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 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.