Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754435AbbFRJRX (ORCPT ); Thu, 18 Jun 2015 05:17:23 -0400 Received: from us01smtprelay-2.synopsys.com ([198.182.47.9]:58856 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753943AbbFRJRP (ORCPT ); Thu, 18 Jun 2015 05:17:15 -0400 Message-ID: <55828C71.5060800@synopsys.com> Date: Thu, 18 Jun 2015 14:46:33 +0530 From: Vineet Gupta User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 Newsgroups: gmane.linux.kernel,gmane.linux.kernel.cross-arch To: Geert Uytterhoeven , Claudiu Zissulescu CC: Michal Marek , "linux-arch@vger.kernel.org" , lkml Subject: Re: subtle side effect of commit a1c48bb160f836 References: <55826966.6050202@synopsys.com> <20150618081329.GA9434@pobox.suse.cz> <55828527.8050901@synopsys.com> In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.12.197.3] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1993 Lines: 46 +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 > 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. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/