From: "H. Peter Anvin" <hpa@zytor.com>
To: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Cc: Ingo Molnar <mingo@elte.hu>,
akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
"Frank Ch. Eigler" <fche@redhat.com>
Subject: Re: [patch 0/2] Immediate Values - jump patching update
Date: Tue, 29 Apr 2008 08:35:57 -0700 [thread overview]
Message-ID: <4817405D.2020400@zytor.com> (raw)
In-Reply-To: <20080429121839.GA29912@Krystal>
Mathieu Desnoyers wrote:
> I would also like to point out that maintaining a _separated_ piece of
> code for each instrumentation site which would heavily depend on the
> inner kernel data structures seems like a maintenance nightmare.
Obviously doing this by hand is insane. That was not my thought.
> I would be happy with a solution that doesn't depend on this gigantic
> DWARF information and can be included in the kernel build process. See,
> I think tracing is, primarily, a facility that the kernel should provide
> to users so they can tune and find problems in their own applications.
> From this POV, it would make sense to consider tracing as part of the
> kernel code itself, not as a separated, kernel debugging oriented piece
> of code. If you require per-site dynamic pieces of code, you are only
> adding to the complexity of such a tracer. Actually, an active tracer
> would trash the i-cache quite heavily due to these per-site pieces of
> code. Given that users want a tracer that disturbs as little as
> possible the normal system behavior, I don't think this "per-site"
> pieces of code approach is that good.
That's funny, given that's exactly what you have now.
DWARF information is the way you get this stuff out of the compiler.
That is what it's *there for*. If you don't want to keep it around you
can distill out the information you need and then remove it. However,
as I have said about six times now:
THE RIGHT WAY TO DO THIS IS WITH COMPILER SUPPORT.
All these problems is because you're trying to do something behind the
back of the compiler, but not *completely* so.
> Instruction cache bloat inspection :
> If a code region is placed with cache cold instructions (unlikely
> branches), it should not increase the cache impact, since although we
> might use one more cache line, it won't be often loaded in cache because
> all the code that shares this cache line is unlikely.
This is somewhat nice in theory; I've found that gcc tends to interlace
them pretty heavily and so the cache interference even of gcc "out of
line" code is sizable. Furthermore, modern CPUs often speculatively
fetch *both* branches of a conditional.
This is actually the biggest motivation for patching static branches.
> I therefore think that looking only at code size is misleading when
> considering the cache impact of markers, since they have been designed
> to put the bytes as far away as possible from cache-hot memory.
Nice theory. Doesn't work in practice as long as you rely on gcc unlikey().
-hpa
next prev parent reply other threads:[~2008-04-29 15:38 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-28 3:34 [patch 0/2] Immediate Values - jump patching update Mathieu Desnoyers
2008-04-28 3:34 ` [patch 1/2] Immediate Values - jump liveliness Mathieu Desnoyers
2008-04-28 3:34 ` [patch 2/2] Markers - use imv_cond " Mathieu Desnoyers
2008-04-28 12:48 ` [patch 0/2] Immediate Values - jump patching update Ingo Molnar
2008-04-28 14:35 ` Mathieu Desnoyers
2008-04-28 17:21 ` H. Peter Anvin
2008-04-28 20:25 ` Ingo Molnar
2008-04-28 21:03 ` H. Peter Anvin
2008-04-28 22:11 ` Ingo Molnar
2008-04-28 22:25 ` H. Peter Anvin
2008-04-28 22:44 ` Ingo Molnar
2008-04-28 23:06 ` H. Peter Anvin
2008-04-29 0:47 ` Frank Ch. Eigler
2008-04-29 1:08 ` H. Peter Anvin
2008-04-29 12:08 ` Ingo Molnar
2008-05-14 14:53 ` Pavel Machek
2008-04-29 1:46 ` Mathieu Desnoyers
2008-04-29 2:07 ` H. Peter Anvin
2008-04-29 12:18 ` Mathieu Desnoyers
2008-04-29 15:35 ` H. Peter Anvin [this message]
2008-05-04 14:54 ` Mathieu Desnoyers
2008-05-04 21:05 ` 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=4817405D.2020400@zytor.com \
--to=hpa@zytor.com \
--cc=akpm@linux-foundation.org \
--cc=fche@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@polymtl.ca \
--cc=mingo@elte.hu \
/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.