Re: [PATCH v1 2/2] perf/x86: Reduce is_hybrid calls and aid ellision of BUG_ON in hybrid_pmu
From: Peter Zijlstra
Date: Thu Mar 12 2026 - 04:41:10 EST
On Wed, Mar 11, 2026 at 10:48:10PM -0700, Ian Rogers wrote:
> Use the capabilities of the PMU rather than the global variable
> perf_is_hybrid to determine if a hybrid pmu has been passed to the
> main accessors. As the pmu capabilities check mirrors that in
> is_x86_pmu, the BUG_ON(!is_x86_pmu...) in hybrid_pmu can be elided as
> it is provably always false (with sufficient function inlining, common
> sub-expression elimination, etc.) in its most common uses.
perf_is_hybrid is not a variable, its a static_branch. You're adding a
runtime branch here, for no appreciable benefit.
And while (Intel) client seems flooded with this hybrid nonsense,
servers are still sane. Also AMD have uniform PMU across their regular
and compact cores and don't need this either.