Re: [PATCH] perf/x86/intel/lbr: Optimize context switches for LBR

2018-09-17 Thread Alexey Budankov
Hello Kan and Andi, On 14.09.2018 17:57, linux-kernel-ow...@vger.kernel.org wrote: > > > On 9/14/2018 10:27 AM, Andi Kleen wrote: >> On Fri, Sep 14, 2018 at 08:39:36AM -0400, Liang, Kan wrote: >>> >>> >>> On 9/14/2018 5:22 AM, Alexey Budankov wrote: Hi Andi, On 14.09.2018 11:

Re: [PATCH] perf/x86/intel/lbr: Optimize context switches for LBR

2018-09-14 Thread Liang, Kan
On 9/14/2018 10:27 AM, Andi Kleen wrote: On Fri, Sep 14, 2018 at 08:39:36AM -0400, Liang, Kan wrote: On 9/14/2018 5:22 AM, Alexey Budankov wrote: Hi Andi, On 14.09.2018 11:54, Andi Kleen wrote: In principle the LBRs need to be flushed between threads. So does current code. IMHO, ideal

Re: [PATCH] perf/x86/intel/lbr: Optimize context switches for LBR

2018-09-14 Thread Andi Kleen
On Fri, Sep 14, 2018 at 08:39:36AM -0400, Liang, Kan wrote: > > > On 9/14/2018 5:22 AM, Alexey Budankov wrote: > > > > Hi Andi, > > > > On 14.09.2018 11:54, Andi Kleen wrote: > > > > > In principle the LBRs need to be flushed between threads. So does > > > > > current code. > > > > > > > > IMH

Re: [PATCH] perf/x86/intel/lbr: Optimize context switches for LBR

2018-09-14 Thread Liang, Kan
On 9/14/2018 5:22 AM, Alexey Budankov wrote: Hi Andi, On 14.09.2018 11:54, Andi Kleen wrote: In principle the LBRs need to be flushed between threads. So does current code. IMHO, ideally, LBRs stack would be preserved and restored when switching between execution stacks. That would allow

Re: [PATCH] perf/x86/intel/lbr: Optimize context switches for LBR

2018-09-14 Thread Alexey Budankov
Hi Andi, On 14.09.2018 11:54, Andi Kleen wrote: >>> In principle the LBRs need to be flushed between threads. So does >>> current code. >> >> IMHO, ideally, LBRs stack would be preserved and restored when >> switching between execution stacks. That would allow implementing >> per-thread statis

Re: [PATCH] perf/x86/intel/lbr: Optimize context switches for LBR

2018-09-14 Thread Andi Kleen
> > In principle the LBRs need to be flushed between threads. So does > > current code. > > IMHO, ideally, LBRs stack would be preserved and restored when > switching between execution stacks. That would allow implementing > per-thread statistical call graph view in Perf tools, fully based > on

Re: [PATCH] perf/x86/intel/lbr: Optimize context switches for LBR

2018-09-13 Thread Alexey Budankov
Hi, On 13.09.2018 23:08, linux-kernel-ow...@vger.kernel.org wrote: > From: Kan Liang > > LBR can bring big overhead when the benchmark has high context switches. > For example, a sub benchmark of Dacapo, avrora. > > Baseline: java -jar dacapo-9.12-MR1-bach.jar avrora -n 20 > With LBR: perf reco

[PATCH] perf/x86/intel/lbr: Optimize context switches for LBR

2018-09-13 Thread kan . liang
From: Kan Liang LBR can bring big overhead when the benchmark has high context switches. For example, a sub benchmark of Dacapo, avrora. Baseline: java -jar dacapo-9.12-MR1-bach.jar avrora -n 20 With LBR: perf record --branch-filter any,u -- java -jar dacapo-9.12-MR1-bach.jar avrora -n 20 Basel