From: Sudeep Holla <sudeep.holla@arm.com>
To: John Garry <john.garry@huawei.com>
Cc: Jeremy Linton <jeremy.linton@arm.com>,
"Guohanjun (Hanjun Guo)" <guohanjun@huawei.com>,
ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
"liuqi (BA)" <liuqi115@huawei.com>,
Sudeep Holla <sudeep.holla@arm.com>
Subject: Re: About PPTT find_acpi_cpu_topology_package()
Date: Wed, 12 Feb 2020 11:59:45 +0000 [thread overview]
Message-ID: <20200212115945.GA36981@bogus> (raw)
In-Reply-To: <7a888a84-d4c5-2b49-05f3-29876d49cae6@huawei.com>
On Wed, Feb 12, 2020 at 11:20:12AM +0000, John Garry wrote:
> Hi Jeremy,
>
> I have a question about $subject for you, since you wrote the code.
>
> This function returns a unique identifier for the package, but would not be
> the logically indexed package id we would expect, like 0, 1, 2, ...
>
Firstly, it must be physical socket number and not logical id.
> It returns of the offset in the PPTT of the topology physical CPU node.
>
Yes, intentionally. We don't want to generate a logical index for this.
Simply not going to happen as we can't guarantee unique number always.
We need to get that uniqueness from the firmware and hence the choice of
offset. Remember that the offset is used only if firmware conveniently
ignored all the optional properties including UID in the processor
container representing the physical socket.
> So I may get something like this:
>
> john@ubuntu:~$ more
> /sys/devices/system/cpu/cpu80/topology/physical_package_id
> 5418
>
Good, now the platform have a reason to fix it in the firmware if it is
very hard to see and understand the above value.
> For sure, this does not violate the ABI in
> Documentation/ABI/testing/sysfs-devices-system-cpu:
>
Very good to see you are not disagreeing with that :)
> "physical_package_id: physical package id of cpu#. Typically corresponds to
> a physical socket number, but the actual value is architecture and platform
> dependent."
>
> Question: Is there any reason for which we cannot assign an indexed package
> id to each package node?
>
Yes, as mentioned above. We are not going to do extra work for lazy firmware.
Linux also will be lazy on such platform and provide weird unique numbers
like in the above case you have mentioned.
> Some userspace tools rely on a sane meaningful package id, like perf:
>
Good that you mention now. Time to update the firmware then.
[...]
>
> This can only deal with a socket id which fits in a byte. I'd rather not
> change this code if possible.
>
Agreed, add UID to the processor container, job done.
--
Regards,
Sudeep
next prev parent reply other threads:[~2020-02-12 11:59 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-12 11:20 About PPTT find_acpi_cpu_topology_package() John Garry
2020-02-12 11:59 ` Sudeep Holla [this message]
2020-02-12 12:48 ` John Garry
2020-02-12 13:55 ` Sudeep Holla
2020-02-11 18:49 ` Jeremy Linton
2020-02-12 15:36 ` Sudeep Holla
2020-02-12 14:41 ` John Garry
2020-02-11 19:01 ` Jeremy Linton
2020-03-25 11:43 ` John Garry
2020-02-11 19:31 ` Jeremy Linton
2020-02-12 16:41 ` John Garry
2020-02-11 21:12 ` Jeremy Linton
2020-02-13 11:52 ` John Garry
2020-02-13 14:00 ` Sudeep Holla
2020-02-13 14:33 ` John Garry
2020-02-13 16:52 ` Jeremy Linton
2020-02-14 10:35 ` John Garry
2020-02-14 11:22 ` Sudeep Holla
2020-02-12 15:32 ` Sudeep Holla
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=20200212115945.GA36981@bogus \
--to=sudeep.holla@arm.com \
--cc=guohanjun@huawei.com \
--cc=jeremy.linton@arm.com \
--cc=john.garry@huawei.com \
--cc=linux-acpi@vger.kernel.org \
--cc=liuqi115@huawei.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