[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/4] x86/idle: Get PC{8..10} counters for Tiger and Alder Lake


  • To: Simon Gaiser <simon@xxxxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 19 Jul 2023 09:53:26 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=g83LjZ1bG8j32x90eKP6T4t7w8TZhBkjeY42mGTpuds=; b=JhBS41ZgWoROoud4NRU5DQ+wG/SSQ5T+P3VmJ8b7prybihen3JgzScdhmNk8Od/qCdEGK7DzyM35veI3Lk3CRWT4/6IJrzInQ3vPLrJdP8WmG0INtcEv7L2PVYQN27muEtNTzvihesMOFvM0w2lFjladM92pzHhav50m68TD2HMNJm9GDOmBLRXiGjbVjfC/sUPVj/kX8kuTtBzUp7u5MvQ0fV+sWmw4h+sfO+B93baeZQk0UrtaLVS0vpHj4z6vbuAu9V/ROQrU1EVbIUOSXR3kK/kfrWEirXMkDswBCkM58jJnVmgmJCem2zMduA4VcpeAHp304CSW1tXnuPdMBQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ivWAknSe4nB1a2dpp4NG48Lg0FoxB/GH7X3aZBqaP6Besclkq5a0t9rW1j/Lf03jIC9SbineXgllYwg3XhlcUjpk5BZbXK/QlRDbmU99AKlpGiA3co/2r+zALweMD+nhkO7SN1imgs/kYFmH3Zx9pc6CrFq4bU0tHv69tb+WlpXRy92Bel4IHp9qo4sFPR867HPXuDSLfPsBT3Q+9/Gcf7SY0t9r7xzQamvaPCPY8vOigKlcYCf7Sdv19CWYthXkg1V4TjsyK/067d5S2r8rbfsXhaaJ8N+/7qAe4ufbrZvQAoMCX13vVunzfQNiKpVaJzWrXWwXPBu9s+6N3G00OQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 19 Jul 2023 07:53:43 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 18.07.2023 22:17, Simon Gaiser wrote:
> Jan Beulich:
>> On 18.07.2023 15:46, Simon Gaiser wrote:
>>> Jan Beulich:
>>>> On 18.07.2023 15:23, Simon Gaiser wrote:
>>>>> ---
>>>>>  xen/arch/x86/acpi/cpu_idle.c | 9 ++++++---
>>>>>  1 file changed, 6 insertions(+), 3 deletions(-)
>>>>
>>>> This lacks both S-o-b and a proper description. The latter in
>>>> particular because you ...
>>>
>>> Yeah, I also noticed in the meantime, sorry. Will be fixed in v2.
>>>
>>>>> --- a/xen/arch/x86/acpi/cpu_idle.c
>>>>> +++ b/xen/arch/x86/acpi/cpu_idle.c
>>>>> @@ -155,6 +155,12 @@ static void cf_check do_get_hw_residencies(void *arg)
>>>>>  
>>>>>      switch ( c->x86_model )
>>>>>      {
>>>>> +    /* Tiger Lake */
>>>>> +    case 0x8C:
>>>>> +    case 0x8D:
>>>>> +    /* Alder Lake */
>>>>> +    case 0x97:
>>>>> +    case 0x9A:
>>>>>      /* 4th generation Intel Core (Haswell) */
>>>>>      case 0x45:
>>>>>          GET_PC8_RES(hw_res->pc8);

One note here: Please follow what we do later in this switch and
maintain roughly time-wise ordering between the case blocks. IOW
you want to insert below the Haswell entry, not above.

>>>>> @@ -185,9 +191,6 @@ static void cf_check do_get_hw_residencies(void *arg)
>>>>>      case 0x6C:
>>>>>      case 0x7D:
>>>>>      case 0x7E:
>>>>> -    /* Tiger Lake */
>>>>> -    case 0x8C:
>>>>> -    case 0x8D:
>>>>>      /* Kaby Lake */
>>>>>      case 0x8E:
>>>>>      case 0x9E:
>>>>
>>>> ... don't just add new case labels, but you actually move two. It
>>>> wants explaining whether this was outright wrong, or what else
>>>> causes the movement.
>>>
>>> Yes, as the commit message says it get those PC{8..10} counters for
>>> Tiger and Alder Lake.
>>
>> But that's the problem - there was no commit message.
> 
> I'm used to that in git "commit message" refers to the whole thing,
> including the "title" (everything till the first blank line. Usually
> only a single line. Put into the Subject header by format-patch). And
> there it says exactly this, which I considered enough when drafting it.
> Will send a v2 with a more verbose description.
> 
>>> The former already had a label, therefore the
>>> move. I assume that when Tiger Lake was added it was an oversight to not
>>> also read those package C-state counters.
>>
>> Or the SDM wasn't clear, and we needed to err on the safe side.
> 
> The SDM [1] seems to be indeed a mess regarding
> MSR_PKG_C{8..10}_RESIDENCY. If I didn't missed something in that huge
> document it lists PC8 and PC9 only for Intel Core 4th gen with CPUID
> 06_45H (table 2-31). For PC10 it additionally list Atoms starting with
> Goldmont (table 2-12 and references to it).
> 
> But it already contradicts itself by listing on page 5002/5003 06_4Fh
> (some Xeons) as another model that supports those MSRs. It refers to
> table 2-38 there, but that table doesn't contain those MSRs.
> 
> Linux' pmc_core [2] and turbostat [3] both use those MSRs on Tiger and
> Alder Lake. And on my Tiger Lake test system I get useful data from
> there.
> 
> Is the code in Linux a good enough reference?

Well, the SDM has to be the primary reference. Linux can be used, sure,
if the respective commits look trustworthy. Note though that if we were
to follow Linux, yet more changes than what you propose would want
doing, afaics.

Note also that personally I wouldn't accept references to a user space
tool (i.e. turbostat) as justification.

Jan

> [1]:
> I looked at what's currently linked on Intel's website. "325462-080US"
> from "June 2023"
> https://cdrdv2.intel.com/v1/dl/getContent/671200
> 
> [2]:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/platform/x86/intel/pmc/core.c?h=v6.4#n44
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/platform/x86/intel/pmc/tgl.c?h=v6.4#n188
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/platform/x86/intel/pmc/adl.c?h=v6.4#n291
> 
> [3]:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/power/x86/turbostat/turbostat.c?h=v6.4#n5763
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/power/x86/turbostat/turbostat.c?h=v6.4#n5074
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/power/x86/turbostat/turbostat.c?h=v6.4#n5409




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.