public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Patryk Wlazlyn <patryk.wlazlyn@linux.intel.com>
To: Len Brown <lenb@kernel.org>
Cc: len.brown@intel.com, linux-pm@vger.kernel.org
Subject: Re: [PATCH 1/4] tools/power turbostat: Add --no-msr option
Date: Mon, 15 Jan 2024 13:58:16 +0100	[thread overview]
Message-ID: <539e87e1-c2a7-4337-a178-b2dfd0aeeb8a@linux.intel.com> (raw)
In-Reply-To: <CAJvTdK=NRSGz_1Mi_2-zLmqv4VeFiFF25Yw+sqeNLTV--r4TNg@mail.gmail.com>

> 6.7 added probe_platform_features().
> 
> Perhaps after it runs, we can simply update the result to disable
> those impacted by no_msr?
> 
> platform->has_cst_msrs = 0;
> platform->has_nhm_msrs = 0;
> platform->rapl_msrs = 0;
> etc.
> 
> that would avoid having to scatter no_msr in a lot of places.
> 
> of course that begs the question of what to do when a feature is
> available both via MSR and via perf -- which is about to happen...
> 
> it also adds a place for us to make an error when we add a feature --
> but even if we had a table and a bit to say whether the feature is
> available via msr, we'd still have the opportunity to mess that up...

Right. I thought about it, but I didn't like the idea of modifying the
platform information, because of the reasons you outlined above, but
also we might have some logic, along the way that cares if something is
present, but not necessarily use MSR driver (or any other method) to get it.

With these changes, sure there are some no_msr checks scattered around,
but they are usually close to where the data is acquired, making it easy
to add an alternative path.

Modifying the platform_features would require to "unconst" a lot of the
structures.

I think it's more clear to store a platform information in the
platform_features and leave no_msr just to store whether the user
requested the mode. This comes with a few extra checks, but leaves the
structures independent.

  reply	other threads:[~2024-01-15 12:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-12 12:48 [PATCH 0/4] turbostat msr, perf controls and aperf/mperf via perf Patryk Wlazlyn
2024-01-12 12:48 ` [PATCH 1/4] tools/power turbostat: Add --no-msr option Patryk Wlazlyn
2024-01-13  1:00   ` Len Brown
2024-01-15 12:58     ` Patryk Wlazlyn [this message]
2024-01-12 12:48 ` [PATCH 2/4] tools/power turbostat: Add --no-perf option Patryk Wlazlyn
2024-01-13  1:03   ` Len Brown
2024-01-12 12:48 ` [PATCH 3/4] tools/power turbostat: Don't print invalid ucode revision Patryk Wlazlyn
2024-01-13  1:15   ` Len Brown
2024-01-12 12:48 ` [PATCH 4/4] tools/power turbostat: Add reading aperf and mperf via perf API Patryk Wlazlyn
2024-01-13  1:42   ` Len Brown
2024-01-15 10:28     ` Patryk Wlazlyn

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=539e87e1-c2a7-4337-a178-b2dfd0aeeb8a@linux.intel.com \
    --to=patryk.wlazlyn@linux.intel.com \
    --cc=len.brown@intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-pm@vger.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