Re: [PATCH v3 1/n] perf/core: addressing 4x slowdown during per-process profiling of STREAM benchmark on Intel Xeon Phi

From: Mark Rutland
Date: Mon Jun 19 2017 - 08:47:39 EST


On Fri, Jun 16, 2017 at 05:22:29PM +0300, Alexey Budankov wrote:
> On 16.06.2017 17:08, Alexey Budankov wrote:
> >On 16.06.2017 12:09, Mark Rutland wrote:
> >>On Fri, Jun 16, 2017 at 01:10:10AM +0300, Alexey Budankov wrote:
> >>>On 15.06.2017 22:56, Mark Rutland wrote:
> >>>>On Thu, Jun 15, 2017 at 08:41:42PM +0300, Alexey Budankov wrote:
> >>>>>This series of patches continues v2 and addresses captured comments.
> >>
> >>>>>Specifically this patch replaces pinned_groups and flexible_groups
> >>>>>lists of perf_event_context by red-black cpu indexed trees avoiding
> >>>>>data structures duplication and introducing possibility to iterate
> >>>>>event groups for a specific CPU only.
> >>>>
> >>>>If you use --per-thread, I take it the overhead is significantly
> >>>>lowered?
> >>>
> >>>Please ask more.
> >>
> >>IIUC, you're seeing the slowdown when using perf record, correct?
> >
> >Correct. Specifically in per-process mode - without -a option.
> >
> >>
> >>There's a --per-thread option to ask perf record to not duplicate the
> >>event per-cpu.
> >>
> >>If you use that, what amount of slowdown do you see?
>
> After applying all three patches:
>
> - system-wide collection:
>
> [ perf record: Woken up 1 times to write data ]
> [ perf record: Captured and wrote 303.795 MB perf.data (~13272985 samples) ]
> 2162.08user 176.24system 0:12.97elapsed 18021%CPU (0avgtext+0avgdata
> 1187208maxresident)k
> 0inputs+622624outputs (0major+1360285minor)pagefaults 0swaps
>
> - per-process collection:
>
> [ perf record: Woken up 5 times to write data ]
> [ perf record: Captured and wrote 1.079 MB perf.data (~47134 samples) ]
> 2102.39user 153.88system 0:12.78elapsed 17645%CPU (0avgtext+0avgdata
> 1187156maxresident)k
> 0inputs+2272outputs (0major+1181660minor)pagefaults 0swaps
>
> Elapsed times look similar. Data file sizes differ significantly.

Interesting. I wonder if that's because we're losing samples due to
hammering the rb, or if that's a side-effect of this patch.

Does perf report describe any lost chunks?

For comparison, can you give --per-thread a go prior to these patches
being applied?

Thanks,
Mark.