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

From: Peter Zijlstra
Date: Fri Apr 16 2021 - 09:41:18 EST


On Fri, Apr 16, 2021 at 09:19:08PM +0900, Namhyung Kim wrote:
> > Are you actually using mmap() to read? I had a proposal for FORMAT_GROUP
> > like thing for mmap(), but I never implemented that (didn't get the
> > enthousiatic response I thought it would). But yeah, there's nowhere
> > near enough space in there for PERCPU.
>
> Recently there's a patch to do it with rdpmc which needs to mmap first.
>
> https://lore.kernel.org/lkml/20210414155412.3697605-1-robh@xxxxxxxxxx/

Yeah, I'm not sure about that, I've not looked at it recently. The thing
is though; for RDPMC to work, you *NEED* to be on the same CPU as the
counter.

The typical RDPMC use-case is self monitoring.