Re: [PATCH v3 1/2] perf/core: Share an event with multiple cgroups

From: Peter Zijlstra
Date: Tue Apr 20 2021 - 14:45:07 EST


On Wed, Apr 21, 2021 at 03:37:11AM +0900, Namhyung Kim wrote:
> On Tue, Apr 20, 2021 at 7:28 PM Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:

> > You forgot NMI.
>
> Thanks for your explanation. Maybe I'm missing something but
> this event is basically for counting and doesn't allow sampling.
> Do you say it's affected by other sampling events? Note that
> it's not reading from the PMU here, what it reads is a snapshot
> of last pmu->read(event) afaik.

Even !sampling events will trigger NMI to deal with short hardware
counters rolling over. But yes, !sampling can also be updated from NMI
by other events if they're in a group etc..

Basically, always assume NMI/PMI can happen.