From: "Zhang, Rui" <rui.zhang@intel.com>
To: "Hansen, Dave" <dave.hansen@intel.com>, "bp@alien8.de" <bp@alien8.de>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"ak@linux.intel.com" <ak@linux.intel.com>,
"x86@kernel.org" <x86@kernel.org>,
"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
"peterz@infradead.org" <peterz@infradead.org>,
"linux-perf-users@vger.kernel.org"
<linux-perf-users@vger.kernel.org>,
"tglx@linutronix.de" <tglx@linutronix.de>,
"mingo@redhat.com" <mingo@redhat.com>,
"Bityutskiy, Artem" <artem.bityutskiy@intel.com>,
"kan.liang@linux.intel.com" <kan.liang@linux.intel.com>
Subject: Re: [PATCH 1/2] perf/x86/rapl: Add support for Intel Meteor Lake
Date: Sat, 7 Jan 2023 14:07:20 +0000 [thread overview]
Message-ID: <b046750234086000acff8e52b817d8dc7b7efbe9.camel@intel.com> (raw)
In-Reply-To: <a375b136-c4da-0676-7a67-d2308c012b8b@intel.com>
On Fri, 2023-01-06 at 06:50 -0800, Dave Hansen wrote:
> On 1/6/23 06:38, Zhang, Rui wrote:
> > My original proposal is that, instead of maintaining model lists in
> > a
> > series of different drivers, can we use feature flags instead, and
> > maintain them in a central place instead of different drivers. say,
> > something like
> >
> > static const struct x86_cpu_id intel_pm_features[] __initconst = {
> > X86_MATCH_INTEL_FAM6_MODEL(SKYLAKE_L, X86_FEATURE
> > _RAPL | X86_FEATURE_TCC_COOLING),
> > X86_MATCH_INTEL_FAM6_MODEL(SKYLAKE_X, X86_FEATURE
> > _RAPL | X86_FEATURE_UNCORE_FREQ),
> > ...
> > X86_MATCH_INTEL_FAM6_MODEL(ALDERLAKE, X86_FEATURE
> > _RAPL | X86_FEATURE_TCC_COOLING),
> > X86_MATCH_INTEL_FAM6_MODEL(SAPPHIRERAPIDS_X, X86_FEATURE
> > _RAPL | X86_FEATURE_UNCORE_FREQ),
> > ...
> > {},
> > };
> > And then set the feature flags based on this, and make the drivers
> > test
> > the feature flags.
>
> That works if you have very few features. SKYLAKE_X looks to have on
> the order of 15 model-specific features, or at least references in
> the code.
>
> That means that the
>
> X86_MATCH_INTEL_FAM6_MODEL(SKYLAKE_X, ...
>
> list goes on for 15 features. It's even worse than that because
> you'd
> *like* to be able to scan up and down the list looking for, say, "all
> the CPUs that support RAPL". But, if you do that, you actually need
> a
> table -- a really wide table -- for *all* the features and a column
> for
> each.
That's true.
>
> What we have now isn't bad. The only real way to fix this is to have
> the features enumerated *properly*, aka. architecturally.
>
> I get it, Intel doesn't want to dedicate CPUID bits and architecture
> to
> one-offs.
> But, at the point that there are a dozen CPU models across
> three or four different CPU generations, it's time to revisit
> it. Could
> you help our colleagues revisit it, please?
For this RAPL case, I think the biggest problem is the RAPL
*incompatibilities* between model variants as Ingo pointed out.
So a CPUID bit can not solve all the problems.
But given that the biggest inconsistency is the energy unit used on
different generations, I can also check with our colleagues if there is
a software visible way to get the "fixed" energy units rather than
hardcoding it in the driver using a model list.
thanks,
rui
prev parent reply other threads:[~2023-01-07 14:07 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-04 14:58 [PATCH 1/2] perf/x86/rapl: Add support for Intel Meteor Lake Zhang Rui
2023-01-04 14:58 ` [PATCH 2/2] perf/x86/rapl: Add support for Intel Emerald Rapids Zhang Rui
2023-01-04 16:55 ` [PATCH 1/2] perf/x86/rapl: Add support for Intel Meteor Lake Dave Hansen
2023-01-05 6:54 ` Zhang, Rui
2023-01-05 9:55 ` Borislav Petkov
2023-01-06 6:05 ` Zhang, Rui
2023-01-06 10:14 ` Ingo Molnar
2023-01-06 10:39 ` Borislav Petkov
2023-01-06 10:56 ` Ingo Molnar
2023-01-06 11:11 ` Borislav Petkov
2023-01-06 11:33 ` Ingo Molnar
2023-01-06 14:45 ` Zhang, Rui
2023-01-06 14:38 ` Zhang, Rui
2023-01-06 14:49 ` Borislav Petkov
2023-01-06 14:50 ` Dave Hansen
2023-01-07 14:07 ` Zhang, Rui [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b046750234086000acff8e52b817d8dc7b7efbe9.camel@intel.com \
--to=rui.zhang@intel.com \
--cc=ak@linux.intel.com \
--cc=artem.bityutskiy@intel.com \
--cc=bp@alien8.de \
--cc=dave.hansen@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).