linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* About PPTT find_acpi_cpu_topology_package()
@ 2020-02-12 11:20 John Garry
  2020-02-12 11:59 ` Sudeep Holla
  0 siblings, 1 reply; 19+ messages in thread
From: John Garry @ 2020-02-12 11:20 UTC (permalink / raw)
  To: Jeremy Linton
  Cc: Guohanjun (Hanjun Guo), ACPI Devel Maling List, Sudeep Holla, liuqi (BA)

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, ...

It returns of the offset in the PPTT of the topology physical CPU node.

So I may get something like this:

john@ubuntu:~$ more 
/sys/devices/system/cpu/cpu80/topology/physical_package_id
5418

For sure, this does not violate the ABI in 
Documentation/ABI/testing/sysfs-devices-system-cpu:

"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?

Some userspace tools rely on a sane meaningful package id, like perf:

See tools/perf/util/cpumap.c:

int cpu_map__get_die(struct perf_cpu_map *map, int idx, void *data)
{
...

	s = cpu_map__get_socket(map, idx, data);
	if (s == -1)
		return -1;

	/*
	 * Encode socket in bit range 15:8
	 * die_id is relative to socket, and
	 * we need a global id. So we combine
	 * socket + die id
	 */
	if (WARN_ONCE(die_id >> 8, "The die id number is too big.\n"))
		return -1;

...

	return (s << 8) | (die_id & 0xff);
}

This can only deal with a socket id which fits in a byte. I'd rather not 
change this code if possible.

Thanks,
John

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2020-03-25 11:43 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-12 11:20 About PPTT find_acpi_cpu_topology_package() John Garry
2020-02-12 11:59 ` Sudeep Holla
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

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).