RE: [PATCH V2 1/1] perf/core: don't find side-band event from all pmus

From: Liang, Kan
Date: Thu May 12 2016 - 09:30:45 EST




> ---
> Subject: perf/core: don't find side-band event from all pmus
> From: Kan Liang <kan.liang@xxxxxxxxx>
> Date: Wed, 23 Mar 2016 11:24:37 -0700
>
Hi Peter,

Is there something wrong with the patch?
The last time I saw this patch was in your personal tree (kernel/git/peterz/queue.git).
But now I cannot find it anymore.

Thanks,
Kan
> perf_event_aux funciton goes through all pmus and all events in whatever
> contexts to find the side-band event to output, which is unnecessary and
> expensive.
>
> For example, the brk test case in lkp triggers many mmap operations, at the
> time, perf with cycles:pp is also running on the system. As a result, many
> perf_event_aux are invoked, and each would search all pmus and all events.
> If we enable the uncore support (even when uncore event are not really
> used), dozens of uncore pmus will be added into pmus list, which can
> significantly decrease brk_test's ops_per_sec. Based on our test, the
> ops_per_sec without uncore patch is 2647573, while the ops_per_sec with
> uncore patch is only 1768444, which is a 33.2% reduction.
>
> To get at the per cpu side-band event, this patch put the side-band events to
> four categories, which are tracked by 4 per-cpu lists. It only finds the
> interested events from masked category.
> To get at the per task side-band event, each task context for current task will
> be searched. Because we don't want to go update more global state on
> context switch.
>
>
> Cc: vincent.weaver@xxxxxxxxx
> Cc: mingo@xxxxxxxxxx
> Cc: acme@xxxxxxxxxx
> Cc: ak@xxxxxxxxxxxxxxx
> Cc: jolsa@xxxxxxxxxx
> Cc: tglx@xxxxxxxxxxxxx
> Cc: eranian@xxxxxxxxxx
> Cc: alexander.shishkin@xxxxxxxxxxxxxxx
> Reported-by: Huang, Ying <ying.huang@xxxxxxxxxxxxxxx>
> Suggested-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
> Signed-off-by: Kan Liang <kan.liang@xxxxxxxxx>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
> Link: http://lkml.kernel.org/r/1458757477-3781-1-git-send-email-
> kan.liang@xxxxxxxxx