[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [RFC PATCH 0/2] Boot time cpupools
On Tue, 23 Nov 2021, Bertrand Marquis wrote: > Hi Julien, > > > On 23 Nov 2021, at 13:54, Julien Grall <julien@xxxxxxx> wrote: > > > > Hi Stefano, > > > > On 19/11/2021 18:55, Stefano Stabellini wrote: > >> On Fri, 19 Nov 2021, Julien Grall wrote: > >>> I like better Juergen's version. But before agreeing on the command line > >>> , I > >>> would like to understand how Linux is dealing with big.LITTLE today (see > >>> my > >>> question above). > >> I also like Juergen's version better :-) > >> The device tree binding that covers big.LITTLE is the same that covers > >> cpus: Documentation/devicetree/bindings/arm/cpus.yaml > > > > Are you sure? I found > > Documentation/devicetree/bindings/arm/cpu-capacity.txt. > > > >> So basically, you can tell it is a big.LITTLE system because the > >> compatible strings differ between certain cpus, e.g.: > >> cpu@0 { > >> device_type = "cpu"; > >> compatible = "arm,cortex-a15"; > >> reg = <0x0>; > >> }; > >> cpu@1 { > >> device_type = "cpu"; > >> compatible = "arm,cortex-a15"; > >> reg = <0x1>; > >> }; > >> cpu@100 { > >> device_type = "cpu"; > >> compatible = "arm,cortex-a7"; > >> reg = <0x100>; > >> }; > >> cpu@101 { > >> device_type = "cpu"; > >> compatible = "arm,cortex-a7"; > >> reg = <0x101>; > >> }; > > > > I have not found any code in Linux using the compatible. Instead, they all > > seem to use the cpu-map (see drivers/base/arch_topology.c). > > > > Anyway, to me it would be better to parse the Device-Tree over using the > > MIDR. The advantage is we can cover a wide range of cases (you may have > > processor with the same MIDR but different frequency). For now, we could > > create a cpupool per cluster. > > This is a really good idea as this could also work for NUMA systems. > > So reg & ~0xff would give the cluster number ? > > We will probably end up splitting cores into different cpupools even if they > are all the same as there are several CPUs having several clusters but the > same cores (I recall some NXP boards being like that). > > Some device tree also have a cpu-map definition: > cpu-map { > cluster0 { > core0 { > cpu = <&A57_0>; > }; > core1 { > cpu = <&A57_1>; > }; > }; > > cluster1 { > core0 { > cpu = <&A53_0>; > }; > core1 { > cpu = <&A53_1>; > }; > core2 { > cpu = <&A53_2>; > }; > core3 { > cpu = <&A53_3>; > }; > }; > }; > > @stefano: is the cpu-map something standard ? Lots of device trees do have it > in Linux now but I do not recall seeing that on older device trees. > Maybe using cpu-map could be a solution, we could say that device tree > without a cpu-map are not supported. cpu-map is newer than big.LITTLE support in Linux. See for instance commit 4ab328f06. Before cpu-map was introduced, Linux used mostly the MPIDR or sometimes the *machine* compatible string. I did find one example of a board where the cpu compatible string is the same for both big and LITTLE CPUs: arch/arm64/boot/dts/rockchip/rk3368.dtsi. That could be the reason why the cpu compatible string is not used for detecting big.LITTLE. Sorry about that, my earlier suggestion was wrong. Yes I think using cpu-map would be fine. It seems to be widely used by different vendors. (Even if something as generic as cpu-map should really be under the devicetree.org spec, not under Linux, but anyway.) Only one note: you mentioned NUMA. As you can see from Documentation/devicetree/bindings/numa.txt, NUMA doesn't use cpu-map. Instead, it uses numa-node-id and distance-map.
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |