From: Ingo Molnar <mingo@elte.hu>
To: Andi Kleen <andi@firstfloor.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
Jason Baron <jbaron@redhat.com>,
linux-kernel@vger.kernel.org, mathieu.desnoyers@polymtl.ca,
hpa@zytor.com, tglx@linutronix.de, rostedt@goodmis.org,
roland@redhat.com, rth@redhat.com, mhiramat@redhat.com,
fweisbec@gmail.com, avi@redhat.com, davem@davemloft.net,
vgoyal@redhat.com, sam@ravnborg.org,
Linus Torvalds <torvalds@linux-foundation.org>,
Arjan van de Ven <arjan@infradead.org>
Subject: Re: [PATCH 03/13] jump label v9: x86 support
Date: Fri, 11 Jun 2010 10:12:56 +0200 [thread overview]
Message-ID: <20100611081256.GA20217@elte.hu> (raw)
In-Reply-To: <20100610162453.GF19561@basil.fritz.box>
* Andi Kleen <andi@firstfloor.org> wrote:
> > > A much better to get smaller kernel images is to do more __cold
> > > annotations for slow paths. Newer gcc will then simply only do -Os for
> > > these functions.
> >
> > That's an opt-in method and we cannot reach the kinds of 30% code size
> > reductions that -Os can achieve. Most code in the kernel is not cache-hot,
> > even on microbenchmarks.
>
> Maybe, maybe not. But yes it can be approached from both ways.
You dont seem to have understood my point: there's a big difference between an
opt-in and an opt-out model.
What you are arguing for is a 'bloaty code generator by default' model and
that model sucks.
Trying to achieve reductions by opt-in marking functions as a 'please reduce
it' __cold marker is a losing battle: most new kernel code is 'cold' and
should be reduced, yet most new code does not (and will not) come with __cold
markers.
The proper model is to assume that everything should be conservatively
size-reduced (because, almost by definition, 90% of new kernel code should
stay small and should stay out of the way), and where benchmarks+importance
proves it we can allow bloatier code generator via __hot.
Important codepaths can get __hot annotations just as much as they are
receiving 'inline' optimizations and other kinds of hand-tuning attention.
> Personally I would prefer to simply write less bloated code to get code
> reductions. Simpler code is often faster too.
You are posing this as an if-else choice, while in reality both should be
done: the best result is to write simpler/faster code _and_ to have a
compact-by-default code generator too ...
> > A much better model would be to actively mark hot codepaths with a __hot
> > attribute instead. Then the code size difference can be considered on a
> > case by case basis.
>
> Yes that works too for those who still use -Os.
>
> e.g. marking the scheduler and a few mm hot paths this way would certain
> make sense.
Possibly, but not without substantiating the rather vague statements you have
made so far.
If you are sending such per function annotation patches then you need to come
up with actual hard numbers as well. One convenient way to measure such things
is a before/after "perf stat --repeat" run - as the noise estimations can be
compared and we can see whether there's a provable effect. (And, of course,
disassembly of GCC suckage is helpful as well.)
Thanks,
Ingo
next prev parent reply other threads:[~2010-06-11 8:13 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-09 21:38 [PATCH 00/13] jump label v9 Jason Baron
2010-06-09 21:38 ` [PATCH 01/13] jump label v9: notifier atomic call chain notrace Jason Baron
2010-06-09 21:58 ` Frederic Weisbecker
2010-06-10 15:34 ` Jason Baron
2010-06-09 21:38 ` [PATCH 02/13] jump label v9: base patch Jason Baron
2010-06-09 22:35 ` Frederic Weisbecker
2010-06-10 15:44 ` Jason Baron
2010-06-10 16:22 ` Ingo Molnar
2010-06-10 17:11 ` Frederic Weisbecker
2010-06-09 22:36 ` Frederic Weisbecker
2010-06-10 12:06 ` Peter Zijlstra
2010-06-10 12:18 ` Peter Zijlstra
2010-06-09 21:39 ` [PATCH 03/13] jump label v9: x86 support Jason Baron
2010-06-10 12:12 ` Peter Zijlstra
2010-06-10 12:14 ` Ingo Molnar
2010-06-10 13:26 ` Andi Kleen
2010-06-10 14:12 ` Peter Zijlstra
2010-06-10 14:28 ` Andi Kleen
2010-06-10 15:37 ` Ingo Molnar
2010-06-10 16:24 ` Andi Kleen
2010-06-11 8:12 ` Ingo Molnar [this message]
2010-06-11 8:30 ` Andi Kleen
2010-06-10 16:29 ` Steven Rostedt
2010-06-10 15:04 ` Jason Baron
2010-06-10 16:13 ` Mathieu Desnoyers
2010-06-11 0:52 ` Jason Baron
2010-06-11 6:18 ` H. Peter Anvin
2010-06-11 7:58 ` Ingo Molnar
2010-06-10 12:15 ` Peter Zijlstra
2010-06-10 12:33 ` Peter Zijlstra
2010-06-09 21:39 ` [PATCH 04/13] jump label v9: tracepoint support Jason Baron
2010-06-10 12:22 ` Peter Zijlstra
2010-06-09 21:39 ` [PATCH 05/13] jump label v9: add module support Jason Baron
2010-06-09 21:39 ` [PATCH 06/13] jump label v9: move ftrace_dyn_arch_init to common code Jason Baron
2010-06-19 3:24 ` Steven Rostedt
2010-06-09 21:39 ` [PATCH 07/13] jump label v9: sort jump table at build-time Jason Baron
2010-06-09 21:39 ` [PATCH 08/13] jump label v9: initialize workqueue tracepoints *before* they are registered Jason Baron
2010-06-09 21:39 ` [PATCH 09/13] jump label v9: jump_label_text_reserved() to reserve our jump points Jason Baron
2010-06-09 21:39 ` [PATCH 10/13] jump label v9: convert jump label to use a key Jason Baron
2010-06-10 12:38 ` Peter Zijlstra
2010-06-10 12:43 ` Peter Zijlstra
2010-06-10 13:57 ` Jason Baron
2010-06-10 14:46 ` Peter Zijlstra
2010-06-09 21:39 ` [PATCH 11/13] jump label v9: convert dynamic debug to use jump labels Jason Baron
2010-06-09 21:39 ` [PATCH 12/13] jump label v9: sparc64 add jump_label support Jason Baron
2010-06-09 21:39 ` [PATCH 13/13] jump label v9: add docs Jason Baron
2010-06-10 12:49 ` Peter Zijlstra
2010-06-15 3:47 ` [PATCH 00/13] jump label v9 David Miller
2010-06-15 14:28 ` Jason Baron
2010-06-15 15:44 ` Mathieu Desnoyers
2010-06-18 3:45 ` Tony Breeds
2010-06-18 15:18 ` Mathieu Desnoyers
2010-06-15 17:13 ` David Miller
2010-06-15 17:28 ` H. Peter Anvin
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=20100611081256.GA20217@elte.hu \
--to=mingo@elte.hu \
--cc=andi@firstfloor.org \
--cc=arjan@infradead.org \
--cc=avi@redhat.com \
--cc=davem@davemloft.net \
--cc=fweisbec@gmail.com \
--cc=hpa@zytor.com \
--cc=jbaron@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@polymtl.ca \
--cc=mhiramat@redhat.com \
--cc=peterz@infradead.org \
--cc=roland@redhat.com \
--cc=rostedt@goodmis.org \
--cc=rth@redhat.com \
--cc=sam@ravnborg.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=vgoyal@redhat.com \
/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.