[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090422072605.GC14687@one.firstfloor.org>
Date: Wed, 22 Apr 2009 09:26:05 +0200
From: Andi Kleen <andi@...stfloor.org>
To: Steven Rostedt <rostedt@...dmis.org>
Cc: Andi Kleen <andi@...stfloor.org>,
Jeremy Fitzhardinge <jeremy@...p.org>,
Mathieu Desnoyers <compudj@...stal.dyndns.org>,
linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...e.hu>,
Andrew Morton <akpm@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>,
Frederic Weisbecker <fweisbec@...il.com>,
Theodore Tso <tytso@....edu>,
Arjan van de Ven <arjan@...radead.org>,
Christoph Hellwig <hch@....de>,
Lai Jiangshan <laijs@...fujitsu.com>,
Zhaolei <zhaolei@...fujitsu.com>, Li Zefan <lizf@...fujitsu.com>,
KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
Masami Hiramatsu <mhiramat@...hat.com>,
"Frank Ch. Eigler" <fche@...stic.org>,
Tom Zanussi <tzanussi@...il.com>,
Jiaying Zhang <jiayingz@...gle.com>,
Michael Rubin <mrubin@...gle.com>,
Martin Bligh <mbligh@...gle.com>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Neil Horman <nhorman@...driver.com>,
Eduard - Gabriel Munteanu <eduard.munteanu@...ux360.ro>,
Pekka@...stfloor.org
Subject: Re: [PATCH 2/8] tracing: create automated trace defines
On Wed, Apr 22, 2009 at 02:24:17AM -0400, Steven Rostedt wrote:
>
> On Wed, 22 Apr 2009, Andi Kleen wrote:
>
> > > I think it was Ingo that let out the idea, and I'm starting to like it.
> > >
> > > Perhaps we should fork off gcc and ship Linux with its own compiler. This
> > > way we can optimize it for the kernel and not worry about any userland
> > > optimizations.
> > >
> > > I would like to do something like:
> > >
> > > if (unlikely(err)) {
> > > __section__(".error_sect") {
> >
> >
> > gcc already supports that, you don't need to fork anything. It's called
> > hot/cold partitioning. Basically it splits functions into hot and cold
> > and unlikely parts and all the cold/unlikely parts go into a separate
> > sections.
> >
> > I think it's normally not enabled by default on x86 though, probably because
> > it doesn't help too much.
> >
> > By default (unless you specify -fno-reorder-blocks) it does the same
> > without sections, just moving unlikely code out of line.
>
> The unlikely code does not always get moved out that far. It still sits
> inside a function, and looking at the tracepoint code it did not move it
> far enough.
That's because you didn't enable the hot/cold partioning as I wrote.
These are separate options. By default it doesn't use partitions on x86,
but it can.
> If gcc can indeed move "unlikely" code completely out of the fast path,
> and put it into its own sections, then I think we should go through the
> kernel and start removing all "likely" and "unlikely"s that are not 99%
> accurate. Then we can enable the separate section cold paths and perhaps
> see a performance benefit.
iirc there wasn't much for using separate partitions with the usual
user space benchmarks (SpecCPU etc.) on x86. It helped a bit on POWER
apparently though.
-Andi
--
ak@...ux.intel.com -- Speaking for myself only.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists