From: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
To: Andrew Morton <akpm@linux-foundation.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] markers-linker-generic
Date: Wed, 11 Apr 2007 13:51:11 -0400 [thread overview]
Message-ID: <20070411175110.GA30879@Krystal> (raw)
In-Reply-To: <20070411074414.GC3752@flint.arm.linux.org.uk>
* Russell King (rmk+lkml@arm.linux.org.uk) wrote:
> On Tue, Apr 10, 2007 at 06:36:58PM -0400, Mathieu Desnoyers wrote:
> > Defines the linker marcro EXTRA_RWDATA for marker data section. It
> > puts the marker data in a separate section that will not pollute the
> > normal .data section, which minimize the cache impact. Markers need such
> > a special section because they define a lot of spreaded and small data
> > structures at multiple sites.
> >
> > This patch also creates the __markers_strings section (ro marker
> > strings) and makes sure the __markers section is aligned by putting it
> > before the __ksymtab_strings (not after).
>
> What's this marker stuff about?
>
Hi Russel,
Here is an overview :
This marker infrastructure is a hook-callback mechanism. It is
meant to have an impact as low as possible on the system performances
when no callback (probe) is connected so markers (hooks) can be
compiled into a production kernel without noticeable slowdown.
The rationale behind this mechanism the following :
1 - It makes sense to have instrumentation (for tracing, profiling)
within the kernel source tree so that it can follow its evolution.
Other options, such as kprobes, imply maintaining an external set of
instrumentation that must be adapted to each kernel version.
Although it may make sense for distributions, it is not well suited
for kernel developers, since they rarely work on a major
distribution image.
2 - kprobes, although being a very good attempt at providing a dynamic
hooking mechanism that has no impact when disabled, suffers from
important limitations :
a - It cannot access local variables of a function at a particular
point within its body that will be consistent thorough the kernel
versions without involving a lot of recurrent hair-pulling.
b - Kprobes is slow, since it involves going though a trap each time
a probe site is executed. Even though the djprobes project made a
good effort to make things faster, it cannot currently instrument
fully-preemptible kernels and does not solve (1), (2a) and (2c).
c - On the reentrancy side, going though a trap (thus playing with
interrupt enable/disable) and taking spinlocks are not suited to
some code paths, i.e. :
kernel/lockdep.c, printk (within the lockdep_on()/lockdep_off()).
It must be understood that some code paths interesting for
instrumentation often present a particular reentrancy challenge.
Some more details :
The probe callback connection to its markers is done dynamically. A
predicted branch is used to skip the hook stack setup and function call
when the marker is "disabled" (no probe is connected). Further
optimizations can be implemented for each architecture to make this
branch faster.
Instrumentation of a subsystem becomes therefore a straightforward task.
One has to add instrumentation within the key locations of the kernel
code in the following form :
MARK(subsystem_event, "%d %p", myint, myptr);
I will be glad to discuss more specific questions that may arise about
the markers.
Regards,
Mathieu
--
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
next prev parent reply other threads:[~2007-04-11 17:51 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-10 22:36 [PATCH] markers-linker-generic Mathieu Desnoyers
2007-04-10 22:48 ` [PATCH] markers-linker-m68knommu Mathieu Desnoyers
2007-04-10 22:49 ` [PATCH] markers-linker-mips Mathieu Desnoyers
2007-04-10 22:50 ` [PATCH] markers-linker-parisc Mathieu Desnoyers
2007-04-10 22:51 ` [PATCH] markers-linker-powerpc Mathieu Desnoyers
2007-04-10 22:52 ` [PATCH] markers-linker-ppc Mathieu Desnoyers
2007-04-10 22:53 ` [PATCH] markers-linker-s390 Mathieu Desnoyers
2007-04-10 22:54 ` [PATCH] markers-linker-sh Mathieu Desnoyers
2007-04-10 22:54 ` [PATCH] markers-linker-sh64 Mathieu Desnoyers
2007-04-10 22:55 ` [PATCH] markers-linker-sparc Mathieu Desnoyers
2007-04-10 22:56 ` [PATCH] markers-linker-sparc64 Mathieu Desnoyers
2007-04-10 22:57 ` [PATCH] markers-linker-um Mathieu Desnoyers
2007-04-10 22:58 ` [PATCH] markers-linker-v850 Mathieu Desnoyers
2007-04-10 22:58 ` [PATCH] markers-linker-x86_64 Mathieu Desnoyers
2007-04-10 22:59 ` [PATCH] markers-linker-xtensa Mathieu Desnoyers
2007-04-11 7:44 ` [PATCH] markers-linker-generic Russell King
2007-04-11 17:51 ` Mathieu Desnoyers [this message]
2007-04-11 18:02 ` Andrew Morton
2007-04-11 19:21 ` Mathieu Desnoyers
2007-04-11 21:45 ` Jim Keniston
2007-04-12 0:21 ` Vara Prasad
2007-04-11 20:41 ` Mathieu Desnoyers
2007-04-11 22:58 ` Frank Ch. Eigler
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=20070411175110.GA30879@Krystal \
--to=mathieu.desnoyers@polymtl.ca \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox