lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20210819081303.188008-1-wangyanan55@huawei.com>
Date:   Thu, 19 Aug 2021 16:13:03 +0800
From:   Yanan Wang <wangyanan55@...wei.com>
To:     <linux-kernel@...r.kernel.org>
CC:     Mark Brown <broonie@...aro.org>,
        Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
        Catalin Marinas <catalin.marinas@....com>,
        Sudeep Holla <sudeep.holla@....com>,
        <wanghaibin.wang@...wei.com>
Subject: [Question] Make the DT cpu-map parser be aware of socket nodes

Hi,

It seems that there is some discrepancy between the kernel documentation
(Documentation/devicetree/bindings/cpu/cpu-topology.txt) and the actual
implementation of DT topology parser for ARM64 (function parse_dt_topology()
in drivers/base/arch_topology.c).

The Doc implies that we can define a cpu-map for the ARM64 multi-socket
system like:
(1) cpu-map
	socket0
		cluster0
			core0
			core1
		cluster1
			core0
			core1
	socket1
		cluster0
			core0
			core1
		cluster1
			core0
			core1

or a cpu-map for 32-bit system like:
(2) cpu-map
        cluster0
                cluster0
                        core0
                        core1
                cluster1
                        core0
                        core1
        cluster1
                cluster0
                        core0
                        core1
                cluster1
                        core0
                        core1

But current parser only assumes that there are nested clusters within
cpu-map and is unaware of socket, the parser also ignore any information
about the nesting of clusters and present the scheduler with a flat list
of them. So based on current parser, we will get "4 packages, 2 cores per
package, 1 threads per core" from (2), but can not generate a valid
topology from (1).

There are two questions that I'm not sure.

1) Why are we using leaf cluster nodes as packages ? To be more consistent with
the concept of package (or sockets), maybe we should use the top-level cluster
nodes as packages, or just make one single socket ?

2) Now it's documented that a cpu-map with socket nodes can be defined for ARM64,
then do we have any plan to make the parser be aware of sockets too ?
Like, we will make each socket nodes as a package instead of the leaf clusters
if there are socket nodes found in the DT. So we will get "2 packages, 4 cores
per package, 1 thread per core" from cpu-map (1).

In virtualization, I hope to describe the user-defined (from QEMU) topology
information (e.g. sockets=2,cores=8,threads=2) through DT, so that the guest
kernel can get the topology. But I'm not sure whether to build the DT in format
"cpu-map/socket%d/core%d/thread%d" or "cpu-map/cluster%d/core%d/thread%d".
Honestly, I think the first one is consistent with the Doc.


Looking forward to some reply, thanks!

Yanan
.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ