[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250416153226.GC17910@noisy.programming.kicks-ass.net>
Date: Wed, 16 Apr 2025 17:32:26 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: "Liang, Kan" <kan.liang@...ux.intel.com>
Cc: Dapeng Mi <dapeng1.mi@...ux.intel.com>, Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Namhyung Kim <namhyung@...nel.org>, Ian Rogers <irogers@...gle.com>,
Adrian Hunter <adrian.hunter@...el.com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Andi Kleen <ak@...ux.intel.com>,
Eranian Stephane <eranian@...gle.com>, linux-kernel@...r.kernel.org,
linux-perf-users@...r.kernel.org, Dapeng Mi <dapeng1.mi@...el.com>
Subject: Re: [Patch v3 12/22] perf/x86/intel: Update dyn_constranit base on
PEBS event precise level
On Tue, Apr 15, 2025 at 12:31:03PM -0400, Liang, Kan wrote:
> > This can land us in EVENT_CONSTRAINT_OVERLAP territory, no?
> The dyn_constraint is a supplement of the static constraints. It doesn't
> overwrite the static constraints.
That doesn't matter.
> In the intel_get_event_constraints(), perf always gets the static
> constraints first. If the dyn_constraint is defined, it gets the common
> mask of the static constraints and the dynamic constraints. All
> constraint rules will be complied.
>
> if (event->hw.dyn_constraint != ~0ULL) {
> c2 = dyn_constraint(cpuc, c2, idx);
> c2->idxmsk64 &= event->hw.dyn_constraint;
> c2->weight = hweight64(c2->idxmsk64);
> }
Read the comment that goes with EVENT_CONSTRAINT_OVERLAP().
Suppose we have (from intel_lnc_event_constraints[]):
INTEL_UEVENT_CONSTRAINT(0x012a, 0xf)
INTEL_EVENT_CONSTRAINT(0x2e, 0x3ff)
Then since the first is fully contained in the latter, there is no
problem.
Now imagine PEBS gets a dynamic constraint of 0x3c (just because), and
then you try and create a PEBS event along with the above two events,
and all of a sudden you have:
0x000f
0x003c
0x03ff
And that is exactly the problem case.
Also, looking at that LNC table, please explain:
INTEL_UEVENT_CONSTRAINT(0x01cd, 0x3fc)
that looks like the exact thing I've asked to never do, exactly because
of the above problem :-(
Powered by blists - more mailing lists