From: Ingo Molnar <mingo@elte.hu>
To: Will Deacon <will.deacon@arm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
LKML <linux-kernel@vger.kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Paul Mackerras <paulus@samba.org>,
Stephane Eranian <eranian@google.com>,
Paul Mundt <lethal@linux-sh.org>,
David Miller <davem@davemloft.net>,
Borislav Petkov <bp@amd64.org>,
Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [RFC PATCH 0/0 v3] callchain fixes and cleanups
Date: Wed, 18 Aug 2010 18:15:20 +0200 [thread overview]
Message-ID: <20100818161520.GB31834@elte.hu> (raw)
In-Reply-To: <1282122527.14913.17.camel@e102144-lin.cambridge.arm.com>
* Will Deacon <will.deacon@arm.com> wrote:
> On Wed, 2010-08-18 at 04:55 +0100, Frederic Weisbecker wrote:
> > On Tue, Aug 17, 2010 at 11:32:39AM +0100, Will Deacon wrote:
> > > I've tested this on an ARM Cortex-A9 board and it all seems fine [plus
> > > the code is a lot cleaner!].
> > >
> > > Tested-by: Will Deacon <will.deacon@arm.com>
> >
> > Thanks a lot!
>
> > BTW, out of curiosity, do you have NMIs on ARM and do the hardware events
> > make use of them? Or may be you use FIQ to simulate NMIs?
> >
>
> We don't have NMIs on ARM [so obviously we can't use them!] but you're right
> to point out the FIQ. I've actually been thinking about this during the past
> week, but there are the following problems:
>
> (1) The FIQ isn't always wired up in the hardware, so you can't
> assume that it is available.
We dont always have NMIs on x86 either - we fall back to hrtimers in that
case.
> (2) The FIQ can only have a single handler at a given time. This
> is because it is a separate exception mode, with its own banked
> registers. Consequently, we might not be able to use it if it's
> being used for something else.
Technically the NMI is only a single exception source on x86 as well. We
multiplex from there - if there are multiple users we call them using a
notifier chain.
> (3) The Trustzone security extensions may reserve the FIQ for secure
> use only or make it available only via the secure monitor [which
> will increase latency].
As long as it can still be detected during PMU init and set up safely, it
should be OK.
> Of course, the advantage is that we could then use sample-based profiling
> techniques in sections of code where the interrupts are disabled.
Once you've tried NMI profiling you wont be going back - the difference is day
and night ;-)
Here's the profile of a scheduling-intense workload using a timer based
fallback path:
# Events: 586 cycles
#
# Overhead Command Shared Object Symbol
# ........ ............ ................. ...........................
#
21.33% pipe-test-1m [kernel.kallsyms] [k] finish_task_switch
14.33% pipe-test-1m [kernel.kallsyms] [k] _raw_spin_unlock_irqrestore
4.61% pipe-test-1m [kernel.kallsyms] [k] avc_has_perm_noaudit
3.75% pipe-test-1m [kernel.kallsyms] [k] pipe_read
3.58% pipe-test-1m libc-2.12.so [.] __write_nocancel
3.58% pipe-test-1m [kernel.kallsyms] [k] copy_user_generic_string
3.41% pipe-test-1m libc-2.12.so [.] __GI___libc_read
3.07% pipe-test-1m [kernel.kallsyms] [k] system_call_after_swapgs
3.07% pipe-test-1m [kernel.kallsyms] [k] pipe_write
3.07% pipe-test-1m [kernel.kallsyms] [k] file_has_perm
2.22% pipe-test-1m pipe-test-1m [.] main
2.22% pipe-test-1m [kernel.kallsyms] [k] selinux_file_permission
1.88% pipe-test-1m [kernel.kallsyms] [k] rw_verify_area
1.88% pipe-test-1m [kernel.kallsyms] [k] fsnotify
# Events: 23K cycles
#
# Overhead Command Shared Object Symbol
# ........ ............ ................. ...................................
#
7.14% pipe-test-1m [kernel.kallsyms] [k] __default_send_IPI_dest_field
4.34% pipe-test-1m [kernel.kallsyms] [k] schedule
4.27% pipe-test-1m [kernel.kallsyms] [k] __switch_to
3.88% pipe-test-1m [kernel.kallsyms] [k] pipe_read
3.57% pipe-test-1m [kernel.kallsyms] [k] switch_mm
3.45% pipe-test-1m [kernel.kallsyms] [k] file_has_perm
3.37% pipe-test-1m [kernel.kallsyms] [k] copy_user_generic_string
3.37% pipe-test-1m pipe-test-1m [.] main
3.20% pipe-test-1m [kernel.kallsyms] [k] avc_has_perm_noaudit
2.62% pipe-test-1m libc-2.12.so [.] __GI___libc_read
2.09% pipe-test-1m [kernel.kallsyms] [k] fsnotify
1.96% pipe-test-1m [kernel.kallsyms] [k] system_call
1.94% pipe-test-1m [kernel.kallsyms] [k] pipe_write
1.90% pipe-test-1m libc-2.12.so [.] __write_nocancel
1.88% pipe-test-1m [kernel.kallsyms] [k] mutex_lock
1.88% pipe-test-1m [kernel.kallsyms] [k] selinux_file_permission
1.78% pipe-test-1m [kernel.kallsyms] [k] mutex_unlock
1.66% pipe-test-1m [kernel.kallsyms] [k] _raw_spin_lock_irqsave
1.50% pipe-test-1m [kernel.kallsyms] [k] _raw_spin_unlock_irqrestore
1.23% pipe-test-1m [kernel.kallsyms] [k] vfs_read
1.19% pipe-test-1m [kernel.kallsyms] [k] do_sync_read
1.18% pipe-test-1m [kernel.kallsyms] [k] update_curr
The NMI output is an order of magnitude richer in information.
> The only way I can think of adding this is as a Kconfig option, which, when
> selected, tries to use the FIQ and then falls back to normal IRQs if it
> fails.
Dynamic detection and a fallback path, should be perfectly OK. Kconfig options
have the disadvantage of doubling the test space and halving the tester base
(or worse).
Thanks,
Ingo
prev parent reply other threads:[~2010-08-18 16:15 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-16 20:48 Frederic Weisbecker
2010-08-16 20:48 ` [RFC PATCH 1/6] perf: Drop unappropriate tests on arch callchains Frederic Weisbecker
2010-08-16 20:48 ` [RFC PATCH 2/6] perf: Generalize callchain_store() Frederic Weisbecker
2010-08-17 4:37 ` Paul Mackerras
2010-08-16 20:48 ` [RFC PATCH 3/6] perf: Generalize some arch callchain code Frederic Weisbecker
2010-08-17 3:46 ` Paul Mackerras
2010-08-18 3:51 ` Frederic Weisbecker
2010-08-16 20:48 ` [RFC PATCH 4/6] perf: Factorize callchain context handling Frederic Weisbecker
2010-08-17 4:37 ` Paul Mackerras
2010-08-16 20:48 ` [RFC PATCH 5/6] perf: Fix race in callchains Frederic Weisbecker
2010-08-17 1:34 ` [RFC PATCH 5/6 v4] " Frederic Weisbecker
2010-08-17 4:53 ` Paul Mackerras
2010-08-18 3:49 ` Frederic Weisbecker
2010-08-16 20:48 ` [RFC PATCH 6/6] perf: Humanize the number of contexts Frederic Weisbecker
2010-08-17 4:58 ` [RFC PATCH 0/0 v3] callchain fixes and cleanups Borislav Petkov
2010-08-18 3:53 ` Frederic Weisbecker
2010-08-17 10:32 ` Will Deacon
2010-08-18 3:55 ` Frederic Weisbecker
2010-08-18 9:08 ` Will Deacon
2010-08-18 16:15 ` Ingo Molnar [this message]
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=20100818161520.GB31834@elte.hu \
--to=mingo@elte.hu \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=bp@amd64.org \
--cc=davem@davemloft.net \
--cc=eranian@google.com \
--cc=fweisbec@gmail.com \
--cc=lethal@linux-sh.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paulus@samba.org \
--cc=rostedt@goodmis.org \
--cc=will.deacon@arm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®