[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210904101834.GC4323@worktop.programming.kicks-ass.net>
Date: Sat, 4 Sep 2021 12:18:34 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Song Liu <songliubraving@...com>
Cc: bpf <bpf@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"acme@...nel.org" <acme@...nel.org>,
"mingo@...hat.com" <mingo@...hat.com>,
"kjain@...ux.ibm.com" <kjain@...ux.ibm.com>,
Kernel Team <Kernel-team@...com>
Subject: Re: [PATCH v5 bpf-next 1/3] perf: enable branch record for software
events
On Fri, Sep 03, 2021 at 04:45:29PM +0000, Song Liu wrote:
> Hi Peter,
>
> > On Sep 3, 2021, at 1:27 AM, Peter Zijlstra <peterz@...radead.org> wrote:
> >
> > On Thu, Sep 02, 2021 at 09:57:04AM -0700, Song Liu wrote:
> >
> >> +static int
> >> +intel_pmu_snapshot_branch_stack(struct perf_branch_entry *entries, unsigned int cnt)
> >> +{
> >> + struct cpu_hw_events *cpuc = this_cpu_ptr(&cpu_hw_events);
> >> +
> >> + intel_pmu_disable_all();
> >> + intel_pmu_lbr_read();
> >> + cnt = min_t(unsigned int, cnt, x86_pmu.lbr_nr);
> >> +
> >> + memcpy(entries, cpuc->lbr_entries, sizeof(struct perf_branch_entry) * cnt);
> >> + intel_pmu_enable_all(0);
> >> + return cnt;
> >> +}
> >
> > Given this disables the PMI from 'random' contexts, should we not add
> > IRQ disabling around this to avoid really bad behaviour?
>
> Do you mean we should add (instead of not add) IRQ disable?
Yeah, I tihnk we want local_irq_save()/restore() here.
Powered by blists - more mailing lists