mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Shuah Khan <skhan@linuxfoundation.org>
To: "John B. Wyatt IV" <jwyatt@redhat.com>,
	Thomas Renninger <trenn@suse.com>
Cc: linux-pm@vger.kernel.org, Shuah Khan <shuah@kernel.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	linux-kernel@vger.kernel.org, John Kacur <jkacur@redhat.com>,
	"John B. Wyatt IV" <sageofredondo@gmail.com>,
	Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH] cpupower: Implement CPU physical core querying
Date: Thu, 6 Mar 2025 13:33:56 -0700	[thread overview]
Message-ID: <cf81280a-fd37-436c-aefa-fba5a4df87f6@linuxfoundation.org> (raw)
In-Reply-To: <20250305210901.24177-1-jwyatt@redhat.com>

On 3/5/25 14:08, John B. Wyatt IV wrote:
> This patch is also an issue report. get_cpu_topology will always save
> into cpupower_topology a cores size of 0. The code to handle this looks
> like it was commented out, and what is commented out is missing a curly
> bracket.
> 
> https://elixir.bootlin.com/linux/v6.13.5/source/tools/power/cpupower/lib/cpupower.c#L206-L212
> 
> Inspiration was taken from psutil to implement this by querying
> core_cpu_list. Instead of using a hashmap, I used a sorted array, and
> counted the number of valid unique strings. The counting of this takes
> place before the qsort for .pkg as the following code says it is
> dependent on the order of that sort.
> 
> The previous code claimed Intel CPUs are not numbered correctly. I was
> not able to reproduce that issue and removed that comment and the code.
> 
> This commit was tested with the libcpupower SWIG Python bindings and
> performed correctly on 4 different setups. The most notable is the
> Framework Intel laptop; a hybrid system of 4 P cores (8 threads) and 8 E
> cores (8 threads).
> 
> The 4 setups: A 4 core virt-manager VM running Fedora 41 4c/4t (specs not
> listed) was tested as a sanity test for VMs. A Lenovo Ryzen 7 Pro 7840HS
> 8c/16t. A Supermico Intel(R) Xeon(R) Gold 6330 CPU w/ 56c/112t with 2 CPU
> sockets. A Framework 12th Gen Intel(R) Core(TM) i5-1240P with hybrid
> cores.
> 
> CPU(s):                   16
>    On-line CPU(s) list:    0-15
> Vendor ID:                AuthenticAMD
>    Model name:             AMD Ryzen 7 PRO 7840HS w/ Radeon 780M Graphics
>      CPU family:           25
>      Model:                116
>      Thread(s) per core:   2
>      Core(s) per socket:   8
>      Socket(s):            1
>      Stepping:             1
> 
> CPU(s):                   112
>    On-line CPU(s) list:    0-111
> Vendor ID:                GenuineIntel
>    BIOS Vendor ID:         Intel(R) Corporation
>    Model name:             Intel(R) Xeon(R) Gold 6330 CPU @ 2.00GHz
>      BIOS Model name:      Intel(R) Xeon(R) Gold 6330 CPU @ 2.00GHz  CPU @ 2.0GHz
>      BIOS CPU family:      179
>      CPU family:           6
>      Model:                106
>      Thread(s) per core:   2
>      Core(s) per socket:   28
>      Socket(s):            2
>      Stepping:             6
> 
> CPU(s):                   16
>    On-line CPU(s) list:    0-15
> Vendor ID:                GenuineIntel
>    Model name:             12th Gen Intel(R) Core(TM) i5-1240P
>      CPU family:           6
>      Model:                154
>      Thread(s) per core:   2
>      Core(s) per socket:   12
>      Socket(s):            1
>      Stepping:             3
> 
> Signed-off-by: "John B. Wyatt IV" <jwyatt@redhat.com>
> Signed-off-by: "John B. Wyatt IV" <sageofredondo@gmail.com>
> ---

Thanks. Applied and will include in my PR for 6.15-rc1 to Rafael

https://web.git.kernel.org/pub/scm/linux/kernel/git/shuah/linux.git/log/?h=cpupower

thanks,
-- Shuah

      reply	other threads:[~2025-03-06 20:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-05 21:08 John B. Wyatt IV
2025-03-06 20:33 ` Shuah Khan [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=cf81280a-fd37-436c-aefa-fba5a4df87f6@linuxfoundation.org \
    --to=skhan@linuxfoundation.org \
    --cc=jkacur@redhat.com \
    --cc=jwyatt@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=sageofredondo@gmail.com \
    --cc=shuah@kernel.org \
    --cc=trenn@suse.com \
    /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

all inboxes | Powered by JetHome®