linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf: remove sw events from multiplexing rotation list
@ 2012-09-06 13:23 Stephane Eranian
  2012-09-06 16:01 ` Peter Zijlstra
  0 siblings, 1 reply; 2+ messages in thread
From: Stephane Eranian @ 2012-09-06 13:23 UTC (permalink / raw)
  To: linux-kernel; +Cc: peterz, mingo, fweisbec


Software events (sw,tracepoints,...) do not need to be
multiplexed. However, when using a SW event, the SW PMU
(TYPE_SOFTWARE, TYPE_TRACEPOINT) was added to the per-cpu
rotation_list. That list is used by perf_rotate_context()
to iterate over all the PMUs to rotate event lists and
multiplex.

This is not needed for SW events. Doing this adds some
unnecessary overhead, so drop it by rejecting SW PMUs
in perf_pmu_rotate_start().

Signed-off-by: Stephane Eranian <eranian@google.com>
---

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 7b9df35..40f42b8 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -651,6 +651,10 @@ static void perf_pmu_rotate_start(struct pmu *pmu)
 	struct perf_cpu_context *cpuctx = this_cpu_ptr(pmu->pmu_cpu_context);
 	struct list_head *head = &__get_cpu_var(rotation_list);
 
+	/* no need to mutliplex software events */
+	if (pmu->task_ctx_nr == perf_sw_context)
+		return;
+
 	WARN_ON(!irqs_disabled());
 
 	if (list_empty(&cpuctx->rotation_list))

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] perf: remove sw events from multiplexing rotation list
  2012-09-06 13:23 [PATCH] perf: remove sw events from multiplexing rotation list Stephane Eranian
@ 2012-09-06 16:01 ` Peter Zijlstra
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Zijlstra @ 2012-09-06 16:01 UTC (permalink / raw)
  To: Stephane Eranian; +Cc: linux-kernel, mingo, fweisbec

On Thu, 2012-09-06 at 15:23 +0200, Stephane Eranian wrote:
> Software events (sw,tracepoints,...) do not need to be
> multiplexed. However, when using a SW event, the SW PMU
> (TYPE_SOFTWARE, TYPE_TRACEPOINT) was added to the per-cpu
> rotation_list. That list is used by perf_rotate_context()
> to iterate over all the PMUs to rotate event lists and
> multiplex.
> 
> This is not needed for SW events. Doing this adds some
> unnecessary overhead, so drop it by rejecting SW PMUs
> in perf_pmu_rotate_start().

Thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-09-06 16:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-06 13:23 [PATCH] perf: remove sw events from multiplexing rotation list Stephane Eranian
2012-09-06 16:01 ` Peter Zijlstra

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).