From: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
To: mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org
Cc: benh@kernel.crashing.org, paulus@samba.org,
ebiederm@xmission.com, muriloo@linux.ibm.com,
christophe.leroy@c-s.fr, npiggin@gmail.com, leitao@debian.org,
aneesh.kumar@linux.vnet.ibm.com, linux-kernel@vger.kernel.org,
naveen.n.rao@linux.vnet.ibm.com,
Ravi Bangoria <ravi.bangoria@linux.ibm.com>
Subject: [PATCH] Powerpc/perf: Wire up PMI throttling
Date: Wed, 14 Nov 2018 19:44:25 +0530 [thread overview]
Message-ID: <20181114141425.1892-1-ravi.bangoria@linux.ibm.com> (raw)
Commit 14c63f17b1fde ("perf: Drop sample rate when sampling is too
slow") introduced a way to throttle PMU interrupts if we're spending
too much time just processing those. Wire up powerpc PMI handler to
use this infrastructure.
Signed-off-by: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
---
arch/powerpc/kernel/traps.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 9a86572db1ef..44f85fa22356 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -18,6 +18,7 @@
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/sched/debug.h>
+#include <linux/sched/clock.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/pkeys.h>
@@ -1803,9 +1804,12 @@ void vsx_unavailable_tm(struct pt_regs *regs)
void performance_monitor_exception(struct pt_regs *regs)
{
+ u64 start_clock;
__this_cpu_inc(irq_stat.pmu_irqs);
+ start_clock = sched_clock();
perf_irq(regs);
+ perf_sample_event_took(sched_clock() - start_clock);
}
#ifdef CONFIG_PPC_ADV_DEBUG_REGS
--
2.19.1
next reply other threads:[~2018-11-14 14:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-14 14:14 Ravi Bangoria [this message]
2018-11-15 12:43 ` [PATCH] Powerpc/perf: Wire up PMI throttling Michael Ellerman
2018-11-16 9:56 ` Ravi Bangoria
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=20181114141425.1892-1-ravi.bangoria@linux.ibm.com \
--to=ravi.bangoria@linux.ibm.com \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=benh@kernel.crashing.org \
--cc=christophe.leroy@c-s.fr \
--cc=ebiederm@xmission.com \
--cc=leitao@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=muriloo@linux.ibm.com \
--cc=naveen.n.rao@linux.vnet.ibm.com \
--cc=npiggin@gmail.com \
--cc=paulus@samba.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;
as well as URLs for NNTP newsgroup(s).