arm64:numa: Add numa support for arm64 platforms.
Subsystems (3)
v2 cover arm64:numa: Add numa support for arm64 platforms.
This is v2 patch set to support numa on arm64 based platforms.
Tested these patches on cavium's multinode(2 node topology) simulator.
In this patchset, defined and implemented dt bindings for numa mapping for core and memory. Tested using UEFI which passes multi memory range details through UEFI system table. Tried test-cases present in numactl-2.0.9 package.
v2:
Defined and implemented numa map for memory, cores to node and proximity distance matrix of nodes to each other.
v1:
Initial patchset to support numa on arm64 platforms.
Ganapatrao Kulkarni (4):
arm64: defconfig: increase NR_CPUS range to 2-128
Documentation: arm64/arm: dt bindings for numa. arm64:thunder: Add initial dts for Cavium's Thunder SoC in 2 Node
topology.
arm64:numa: adding numa support for arm64 platforms.
Documentation/devicetree/bindings/arm/numa.txt | 103 ++++ arch/arm64/Kconfig | 37 +- arch/arm64/boot/dts/thunder-88xx-2n.dts | 88 ++++ arch/arm64/boot/dts/thunder-88xx-2n.dtsi | 694 +++++++++++++++++++++++++ arch/arm64/include/asm/mmzone.h | 32 ++ arch/arm64/include/asm/numa.h | 35 ++ arch/arm64/kernel/setup.c | 8 + arch/arm64/kernel/smp.c | 2 + arch/arm64/mm/Makefile | 1 + arch/arm64/mm/init.c | 34 +- arch/arm64/mm/numa.c | 631 ++++++++++++++++++++++ 11 files changed, 1657 insertions(+), 8 deletions(-) create mode 100644 Documentation/devicetree/bindings/arm/numa.txt create mode 100644 arch/arm64/boot/dts/thunder-88xx-2n.dts create mode 100644 arch/arm64/boot/dts/thunder-88xx-2n.dtsi create mode 100644 arch/arm64/include/asm/mmzone.h create mode 100644 arch/arm64/include/asm/numa.h create mode 100644 arch/arm64/mm/numa.c
Signature · 1 line
1.8.1.4
RFC PATCH v2 1/4 arm64: defconfig: increase NR_CPUS range to 2-128
Raising the maximum limit to 128. This is needed for Cavium's Thunder system that will have 96 cores on Multi-node system.
--- arch/arm64/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/Kconfig +2 -2
@@ -302,8 +302,8 @@ config SCHED_SMT places. If unsure say N here. config NR_CPUS - int "Maximum number of CPUs (2-64)" - range 2 64 + int "Maximum number of CPUs (2-128)" + range 2 128 depends on SMP # These have to remain sorted largest to smallest default "64"
Signature · 1 line
1.8.1.4
RFC PATCH v2 1/4 arm64: defconfig: increase NR_CPUS range to 2-128
Quoted 5 lines · On Saturday 22 November 2014 02:53:27 Ganapatrao Kulkarni wrote:
Raising the maximum limit to 128. This is needed for Cavium's Thunder system that will have 96 cores on Multi-node system.
Signed-off-by Ganapatrao Kulkarni <[email protected]>
Could we please raise the compile-time limit to the highest number that you are able to boot successfully on some existing machine?
There isn't much point in doubling this every few months.
Arnd
RFC PATCH v2 1/4 arm64: defconfig: increase NR_CPUS range to 2-128
Hi Arnd,
Quoted 5 lines · Arnd Bergmann
Quoted 3 lines · On Saturday 22 November 2014 02:53:27 Ganapatrao Kulkarni wrote:
Raising the maximum limit to 128. This is needed for Cavium's Thunder system that will have 96 cores on Multi-node system.
Quoted 7 lines
Quoted 2 lines
Signed-off-by Ganapatrao Kulkarni <[email protected]>Could we please raise the compile-time limit to the highest number that you are able to boot successfully on some existing machine?
There isn't much point in doubling this every few months.
Agreed. If we look back at [1], Mark Rutland has actually compiled and boot-tested NR_CPUS=4096 on Juno.
[1] https://lkml.org/lkml/2014/9/8/537
Quoted 7 lines
Arnd
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
RFC PATCH v2 1/4 arm64: defconfig: increase NR_CPUS range to 2-128
Quoted 14 lines · On Monday 08 December 2014 17:57:03 Zi Shen Lim wrote:
Hi Arnd,
Quoted 11 lines · Arnd Bergmann
Quoted 5 lines · On Saturday 22 November 2014 02:53:27 Ganapatrao Kulkarni wrote:
Raising the maximum limit to 128. This is needed for Cavium's Thunder system that will have 96 cores on Multi-node system.
Signed-off-by Ganapatrao Kulkarni <[email protected]>Could we please raise the compile-time limit to the highest number that you are able to boot successfully on some existing machine?
Quoted 6 lines
Quoted 1 line
There isn't much point in doubling this every few months.
Agreed. If we look back at [1], Mark Rutland has actually compiled and boot-tested NR_CPUS=4096 on Juno.
Ok, 4096 sounds like a good NR_CPUS limit then, it should last for a while.
For the defconfig, we probably want a much smaller value, either one that covers all known machines (96 at this time), or something that covers 95% of all users (maybe 32?) and does not have an serious impact on memory consumption or performance on small machines.
Arnd
RFC PATCH v2 1/4 arm64: defconfig: increase NR_CPUS range to 2-128
Quoted 15 lines · Arnd Bergmann
Quoted 14 lines · On Monday 08 December 2014 17:57:03 Zi Shen Lim wrote:
Hi Arnd,
Quoted 11 lines · Arnd Bergmann
Quoted 5 lines · On Saturday 22 November 2014 02:53:27 Ganapatrao Kulkarni wrote:
Raising the maximum limit to 128. This is needed for Cavium's Thunder system that will have 96 cores on Multi-node system.
Signed-off-by Ganapatrao Kulkarni <[email protected]>Could we please raise the compile-time limit to the highest number that you are able to boot successfully on some existing machine?
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
There isn't much point in doubling this every few months.
Agreed. If we look back at [1], Mark Rutland has actually compiled and boot-tested NR_CPUS=4096 on Juno.
Ok, 4096 sounds like a good
NR_CPUSlimit then, it should last for a while.
Ok, will set range to 2-4096.
Quoted 7 lines
For the defconfig, we probably want a much smaller value, either one that covers all known machines (96 at this time), or something that covers 95% of all users (maybe 32?) and does not have an serious impact on memory consumption or performance on small machines.
Arnd
thanks
Ganapat
RFC PATCH v2 2/4 Documentation: arm64/arm: dt bindings for numa.
In reply to Ganapatrao KulkarniDT bindings for numa map for memory, cores to node and proximity distance matrix of nodes to each other.
--- Documentation/devicetree/bindings/arm/numa.txt | 103 +++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/numa.txt
Documentation/devicetree/bindings/arm/numa.txt new file +103 -0
@@ -0,0 +1,103 @@ +============================================================================== +NUMA binding description. +============================================================================== + +============================================================================== +1 - Introduction +============================================================================== + +Systems employing a Non Uniform Memory Access (NUMA) architecture contain +collections of hardware resources including processors, memory, and I/O buses, +that comprise what is commonly known as a ???NUMA node???. Processor +accesses to memory within the local NUMA node is +generally faster than processor accesses to memory outside of the local +NUMA node. DT defines interfaces that allow the platform to convey NUMA node +topology information to OS. + +============================================================================== +2 - numa-map node +============================================================================== + +DT Binding for NUMA can be defined for memory and CPUs to map them to +respective NUMA nodes. + +The DT binding can defined using numa-map node. +The numa-map will have following properties to define NUMA topology. + +- mem-map: This property defines the association between a range of + memory and the proximity domain/numa node to which it belongs. + +note: memory range address is passed using either memory node of +DT or UEFI system table and should match to the address defined in mem-map. + +- cpu-map: This property defines the association of range of processors + (range of cpu ids) and the proximity domain to which + the processor belongs. + +- node-matrix: This table provides a matrix that describes the relative + distance (memory latency) between all System Localities. + The value of each Entry[i j distance] in node-matrix table, + where i represents a row of a matrix and j represents a + column of a matrix, indicates the relative distances + from Proximity Domain/Numa node i to every other + node j in the system (including itself). + +The numa-map node must contain the appropriate #address-cells, +#size-cells and #node-count properties. + + +============================================================================== +4 - Example dts +============================================================================== + +Example 1: 2 Node system each having 8 CPUs and a Memory. + + numa-map { + #address-cells = <2>; + #size-cells = <1>; + #node-count = <2>; + mem-map = <0x0 0x00000000 0>, + <0x100 0x00000000 1>; + + cpu-map = <0 7 0>, + <8 15 1>; + + node-matrix = <0 0 10>, + <0 1 20>, + <1 0 20>, + <1 1 10>; + }; + +Example 2: 4 Node system each having 4 CPUs and a Memory. + + numa-map { + #address-cells = <2>; + #size-cells = <1>; + #node-count = <2>; + mem-map = <0x0 0x00000000 0>, + <0x100 0x00000000 1>, + <0x200 0x00000000 2>, + <0x300 0x00000000 3>; + + cpu-map = <0 7 0>, + <8 15 1>, + <16 23 2>, + <24 31 3>; + + node-matrix = <0 0 10>, + <0 1 20>, + <0 2 20>, + <0 3 20>, + <1 0 20>, + <1 1 10>, + <1 2 20>, + <1 3 20>, + <2 0 20>, + <2 1 20>, + <2 2 10>, + <2 3 20>, + <3 0 20>, + <3 1 20>, + <3 2 20>, + <3 3 10>; + };
Signature · 1 line
1.8.1.4
RFC PATCH v2 2/4 Documentation: arm64/arm: dt bindings for numa.
Hi,
Quoted 68 lines · Ganapatrao Kulkarni
DT bindings for numa map for memory, cores to node and proximity distance matrix of nodes to each other.
Signed-off-by Ganapatrao Kulkarni <[email protected]>--- Documentation/devicetree/bindings/arm/numa.txt | 103 +++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 Documentation/devicetree/bindings/arm/numa.txtDocumentation/devicetree/bindings/arm/numa.txt new file +53
-0@@ -0,0 +1,103 @@ +============================================================================== +NUMA binding description. +============================================================================== + +============================================================================== +1 - Introduction +============================================================================== + +Systems employing a Non Uniform Memory Access (NUMA) architecture contain +collections of hardware resources including processors, memory, and I/O buses, +that comprise what is commonly known as a ??UMA node?? Processor +accesses to memory within the local NUMA node is +generally faster than processor accesses to memory outside of the local +NUMA node. DT defines interfaces that allow the platform to convey NUMA node +topology information to OS. + +============================================================================== +2 - numa-map node +============================================================================== + +DT Binding for NUMA can be defined for memory and CPUs to map them to +respective NUMA nodes. + +The DT binding can defined using numa-map node. +The numa-map will have following properties to define NUMA topology. + +- mem-map: This property defines the association between a range of + memory and the proximity domain/numa node to which it belongs. + +note: memory range address is passed using either memory node of +DT or UEFI system table and should match to the address defined in mem-map. + +- cpu-map: This property defines the association of range of processors + (range of cpu ids) and the proximity domain to which + the processor belongs. + +- node-matrix: This table provides a matrix that describes the relative + distance (memory latency) between all System Localities. + The value of each Entry[i j distance] in node-matrix table, + where i represents a row of a matrix and j represents a + column of a matrix, indicates the relative distances + from Proximity Domain/Numa node i to every other + node j in the system (including itself). + +The numa-map node must contain the appropriate #address-cells, +#size-cells and #node-count properties. + + +============================================================================== +4 - Example dts +============================================================================== + +Example 1: 2 Node system each having 8 CPUs and a Memory.
Documentation/devicetree/bindings/arm/numa.txt line 63
Quoted 10 lines
Documentation/devicetree/bindings/arm/numa.txt new file +10
-0+ + numa-map { + #address-cells = <2>; + #size-cells = <1>; + #node-count = <2>; + mem-map = <0x0 0x00000000 0>, + <0x100 0x00000000 1>; + + cpu-map = <0 7 0>, + <8 15 1>;
The cpu range is continuous here. But if there is a situation like below:
0 2 4 6 belong to node 0
1 3 5 7 belong to node 1
This case is very common on X86. I don't know the real situation of arm as I don't have a hardware with 2 nodes.
How can we generate a DTS about this situation? like below? Can be parsed?
cpu-map = <0 2 4 6 0>, <1 3 5 7 1>;
Thanks,
Shannon
Quoted 48 lines
Documentation/devicetree/bindings/arm/numa.txt new file +40
-0+ + node-matrix = <0 0 10>, + <0 1 20>, + <1 0 20>, + <1 1 10>; + }; + +Example 2: 4 Node system each having 4 CPUs and a Memory. + + numa-map { + #address-cells = <2>; + #size-cells = <1>; + #node-count = <2>; + mem-map = <0x0 0x00000000 0>, + <0x100 0x00000000 1>, + <0x200 0x00000000 2>, + <0x300 0x00000000 3>; + + cpu-map = <0 7 0>, + <8 15 1>, + <16 23 2>, + <24 31 3>; + + node-matrix = <0 0 10>, + <0 1 20>, + <0 2 20>, + <0 3 20>, + <1 0 20>, + <1 1 10>, + <1 2 20>, + <1 3 20>, + <2 0 20>, + <2 1 20>, + <2 2 10>, + <2 3 20>, + <3 0 20>, + <3 1 20>, + <3 2 20>, + <3 3 10>; + };_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 1 line
Shannon
RFC PATCH v2 2/4 Documentation: arm64/arm: dt bindings for numa.
Quoted 3 lines · Shannon Zhao
Hi,
On 2014/11/22 5:23, Ganapatrao Kulkarni wrote:
[...]
Quoted 21 lines
Quoted 5 lines
+==============================================================================
+4 - Example dts
+==============================================================================Documentation/devicetree/bindings/arm/numa.txt new file +2
-0+ +Example 1: 2 Node system each having 8 CPUs and a Memory.Documentation/devicetree/bindings/arm/numa.txt line 63
Quoted 10 lines
Documentation/devicetree/bindings/arm/numa.txt new file +10
-0+ + numa-map { + #address-cells = <2>; + #size-cells = <1>; + #node-count = <2>; + mem-map = <0x0 0x00000000 0>, + <0x100 0x00000000 1>; + + cpu-map = <0 7 0>, + <8 15 1>;The cpu range is continuous here. But if there is a situation like below:
0 2 4 6 belong to node 0
1 3 5 7 belong to node 1
Quoted 7 lines
This case is very common on X86. I don't know the real situation of arm as I don't have a hardware with 2 nodes.
How can we generate a DTS about this situation? like below? Can be parsed?
cpu-map = <0 2 4 6 0>, <1 3 5 7 1>;
I think the binding proposed here can not cover your needs, and I think this binding is not suitable, there are some reasons.
- CPU logical ID is allocated by OS, and it depends on the order of CPU node in the device tree, so it may be in a clean order like this patch proposed, or it will like the order Shannon pointed out.
- Since CPU logical ID is allocated by OS, DTS file will not know these numbers.
So the problem behind this is the mappings between CPUs and NUMA nodes, there is already mapping for CPU hardware ID (MPIDR) and CPU logical ID, and MPIDR will be not changed, why not using MPIDR for the mapping of NUMA node and CPU? then the mappings will be:
CPU logical ID <------> CPU MPIDR <-----> NUMA node ID <-----> proximity domain
(allocated by OS) (constant) (allocated by OS)
Thanks
Hanjun
RFC PATCH v2 2/4 Documentation: arm64/arm: dt bindings for numa.
Quoted 37 lines · On Tuesday 25 November 2014 17:42:44 Hanjun Guo wrote:
Quoted 3 lines · Shannon Zhao
Hi,
On 2014/11/22 5:23, Ganapatrao Kulkarni wrote:
[...]
Quoted 21 lines
Quoted 5 lines
+==============================================================================
+4 - Example dts
+==============================================================================Documentation/devicetree/bindings/arm/numa.txt new file +2
-0+ +Example 1: 2 Node system each having 8 CPUs and a Memory.Documentation/devicetree/bindings/arm/numa.txt line 63
Quoted 10 lines
Documentation/devicetree/bindings/arm/numa.txt new file +10
-0+ + numa-map { + #address-cells = <2>; + #size-cells = <1>; + #node-count = <2>; + mem-map = <0x0 0x00000000 0>, + <0x100 0x00000000 1>; + + cpu-map = <0 7 0>, + <8 15 1>;The cpu range is continuous here. But if there is a situation like below:
0 2 4 6 belong to node 0
1 3 5 7 belong to node 1Quoted 7 lines
This case is very common on X86. I don't know the real situation of arm as I don't have a hardware with 2 nodes.
How can we generate a DTS about this situation? like below? Can be parsed?
cpu-map = <0 2 4 6 0>, <1 3 5 7 1>;I think the binding proposed here can not cover your needs, and I think this binding is not suitable, there are some reasons.
Quoted 6 lines
- CPU logical ID is allocated by OS, and it depends on the order of CPU node in the device tree, so it may be in a clean order like this patch proposed, or it will like the order Shannon pointed out.
- Since CPU logical ID is allocated by OS, DTS file will not know these numbers.
Also:
- you cannot support hierarchical NUMA topology
- you cannot have CPU-less or memory-less nodes
- you cannot associate I/O devices with NUMA nodes, only memory and CPU
Quoted 7 lines
So the problem behind this is the mappings between CPUs and NUMA nodes, there is already mapping for CPU hardware ID (MPIDR) and CPU logical ID, and MPIDR will be not changed, why not using MPIDR for the mapping of NUMA node and CPU? then the mappings will be:
CPU logical ID <------> CPU MPIDR <-----> NUMA node ID <-----> proximity domain
(allocated by OS) (constant) (allocated by OS)
No, don't hardcode ARM specifics into a common binding either. I've looked at the ibm,associativity properties again, and I think we should just use those, they can cover all cases and are completely independent of the architecture. We should probably discuss about the property name though, as using the "ibm," prefix might not be the best idea.
Arnd
RFC PATCH v2 2/4 Documentation: arm64/arm: dt bindings for numa.
Hi Arnd,
Quoted 58 lines · Arnd Bergmann
Quoted 37 lines · On Tuesday 25 November 2014 17:42:44 Hanjun Guo wrote:
Quoted 3 lines · Shannon Zhao
Hi,
On 2014/11/22 5:23, Ganapatrao Kulkarni wrote:
[...]
Quoted 21 lines
Quoted 5 lines
+==============================================================================
+4 - Example dts
+==============================================================================Documentation/devicetree/bindings/arm/numa.txt new file +2
-0+ +Example 1: 2 Node system each having 8 CPUs and a Memory.Documentation/devicetree/bindings/arm/numa.txt line 63
Quoted 10 lines
Documentation/devicetree/bindings/arm/numa.txt new file +10
-0+ + numa-map { + #address-cells = <2>; + #size-cells = <1>; + #node-count = <2>; + mem-map = <0x0 0x00000000 0>, + <0x100 0x00000000 1>; + + cpu-map = <0 7 0>, + <8 15 1>;The cpu range is continuous here. But if there is a situation like below:
0 2 4 6 belong to node 0
1 3 5 7 belong to node 1Quoted 7 lines
This case is very common on X86. I don't know the real situation of arm as I don't have a hardware with 2 nodes.
How can we generate a DTS about this situation? like below? Can be parsed?
cpu-map = <0 2 4 6 0>, <1 3 5 7 1>;I think the binding proposed here can not cover your needs, and I think this binding is not suitable, there are some reasons.
Quoted 6 lines
- CPU logical ID is allocated by OS, and it depends on the order of CPU node in the device tree, so it may be in a clean order like this patch proposed, or it will like the order Shannon pointed out.
- Since CPU logical ID is allocated by OS, DTS file will not know these numbers.
Also:
- you cannot support hierarchical NUMA topology
- you cannot have CPU-less or memory-less nodes
- you cannot associate I/O devices with NUMA nodes, only memory and CPU
Quoted 5 lines
So the problem behind this is the mappings between CPUs and NUMA nodes, there is already mapping for CPU hardware ID (MPIDR) and CPU logical ID, and MPIDR will be not changed, why not using MPIDR for the mapping of NUMA node and CPU? then the mappings will be:
Quoted 8 lines
Quoted 2 lines
CPU logical ID <------> CPU MPIDR <-----> NUMA node ID <-----> proximity domain
(allocated by OS) (constant) (allocated by OS)No, don't hardcode ARM specifics into a common binding either. I've looked at the ibm,associativity properties again, and I think we should just use those, they can cover all cases and are completely independent of the architecture. We should probably discuss about the property name though, as using the "ibm," prefix might not be the best idea.
We have started with new proposal, since not got enough details how ibm/ppc is managing the numa using dt.
there is no documentation and there is no power/PAPR spec for numa in public domain and there are no single dt file in arch/powerpc which describes the numa. if we get any one of these details, we can align to powerpc implementation.
Quoted 2 lines
Arnd
thanks
ganapat
RFC PATCH v2 2/4 Documentation: arm64/arm: dt bindings for numa.
Quoted 6 lines · On Tuesday 25 November 2014 08:15:47 Ganapatrao Kulkarni wrote:
Quoted 5 lines
No, don't hardcode ARM specifics into a common binding either. I've looked at the ibm,associativity properties again, and I think we should just use those, they can cover all cases and are completely independent of the architecture. We should probably discuss about the property name though, as using the "ibm," prefix might not be the best idea.
Quoted 6 lines
We have started with new proposal, since not got enough details how ibm/ppc is managing the numa using dt.
there is no documentation and there is no power/PAPR spec for numa in public domain and there are no single dt file inarch/powerpcwhich describes the numa. if we get any one of these details, we can align to powerpc implementation.
Basically the idea is to have an "ibm,associativity" property in each bus or device that is node specific, and this includes all CPUs and memory nodes. The property contains an array of 32-bit integers that count the resources. Take an example of a NUMA cluster of two machines with four sockets and four cores each (32 cores total), a memory channel on each socket and one PCI host per board that is connected at equal speed to each socket on the board.
The ibm,associativity property in each PCI host, CPU or memory device node consequently has an array of three (board, socket, core) integers:
memory at 0,0 {
device_type = "memory";
reg = <0x0 0x0 0x4 0x0;
/* board 0, socket 0, no specific core */
ibm,asssociativity = <0 0 0xffff>;
};
memory at 4,0 {
device_type = "memory";
reg = <0x4 0x0 0x4 0x0>;
/* board 0, socket 1, no specific core */
ibm,asssociativity = <0 1 0xffff>;
};
...
memory at 1c,0 {
device_type = "memory";
reg = <0x1c 0x0 0x4 0x0>;
/* board 0, socket 7, no specific core */
ibm,asssociativity = <1 7 0xffff>;
};
cpus {
#address-cells = <2>;
#size-cells = <0>;
cpu at 0 {
device_type = "cpu";
reg = <0 0>;
/* board 0, socket 0, core 0*/
ibm,asssociativity = <0 0 0>;
};
cpu at 1 {
device_type = "cpu";
reg = <0 0>;
/* board 0, socket 0, core 0*/
ibm,asssociativity = <0 0 0>;
};
...
cpu at 31 {
device_type = "cpu";
reg = <0 32>;
/* board 1, socket 7, core 31*/
ibm,asssociativity = <1 7 31>;
};
};
pci at 100,0 {
device_type = "pci";
/* board 0 */
ibm,associativity = <0 0xffff 0xffff>;
...
};
pci at 200,0 {
device_type = "pci";
/* board 1 */
ibm,associativity = <1 0xffff 0xffff>;
...
};
ibm,associativity-reference-points = <0 1>;The "ibm,associativity-reference-points" property here indicates that index 2 of each array is the most important NUMA boundary for the particular system, because the performance impact of allocating memory on the remote board is more significant than the impact of using memory on a remote socket of the same board. Linux will consequently use the first field in the array as the NUMA node ID. If the link between the boards however is relatively fast, so you care mostly about allocating memory on the same socket, but going to another board isn't much worse than going to another socket on the same board, this would be
ibm,associativity-reference-points = <1 0>;
so Linux would ignore the board ID and use the socket ID as the NUMA node number. The same would apply if you have only one (otherwise identical board, then you would get
ibm,associativity-reference-points = <1>;
which means that index 0 is completely irrelevant for NUMA considerations and you just care about the socket ID. In this case, devices on the PCI bus would also not care about NUMA policy and just allocate buffers from anywhere, while in original example Linux would allocate DMA buffers only from the local board.
Arnd
RFC PATCH v2 2/4 Documentation: arm64/arm: dt bindings for numa.
Quoted 14 lines · On Tuesday 25 November 2014 20:00:42 Arnd Bergmann wrote:
Quoted 6 lines · On Tuesday 25 November 2014 08:15:47 Ganapatrao Kulkarni wrote:
Quoted 5 lines
No, don't hardcode ARM specifics into a common binding either. I've looked at the ibm,associativity properties again, and I think we should just use those, they can cover all cases and are completely independent of the architecture. We should probably discuss about the property name though, as using the "ibm," prefix might not be the best idea.
Quoted 6 lines
We have started with new proposal, since not got enough details how ibm/ppc is managing the numa using dt.
there is no documentation and there is no power/PAPR spec for numa in public domain and there are no single dt file inarch/powerpcwhich describes the numa. if we get any one of these details, we can align to powerpc implementation.
Quoted 3 lines
Basically the idea is to have an "ibm,associativity" property in each bus or device that is node specific, and this includes all CPUs and memory nodes. ...
I should have mentioned that the example I gave was still rather basic. In a larger real-world system, you have more levels of associativity, though not all of them are relevant for NUMA memory allocation. Also, when you have levels that are not just a crossbar but instead have multiple point-to-point connections or a ring bus, it gets more complex, but you can still represent it with these properties.
For task placement, the associativity would also represent the topology within one node (SMT threads, cores, clusters, chips, mcms, sockets) as separate levels, and in large installations you would have multiple levels of memory topology (memory controllers, sockets, board/blade, chassis, rack, ...), which can get taken into account for memory allocation to find the closest node. The metric that you use here is how many levels within the topology are matching between two devices (typically memory and i/o device, or memory and cpu).
Arnd
RFC PATCH v2 2/4 Documentation: arm64/arm: dt bindings for numa.
In reply to Arnd BergmannQuoted 107 lines · Arnd Bergmann
Quoted 6 lines · On Tuesday 25 November 2014 08:15:47 Ganapatrao Kulkarni wrote:
Quoted 5 lines
No, don't hardcode ARM specifics into a common binding either. I've looked at the ibm,associativity properties again, and I think we should just use those, they can cover all cases and are completely independent of the architecture. We should probably discuss about the property name though, as using the "ibm," prefix might not be the best idea.
Quoted 6 lines
We have started with new proposal, since not got enough details how ibm/ppc is managing the numa using dt.
there is no documentation and there is no power/PAPR spec for numa in public domain and there are no single dt file inarch/powerpcwhich describes the numa. if we get any one of these details, we can align to powerpc implementation.Basically the idea is to have an "ibm,associativity" property in each bus or device that is node specific, and this includes all CPUs and memory nodes. The property contains an array of 32-bit integers that count the resources. Take an example of a NUMA cluster of two machines with four sockets and four cores each (32 cores total), a memory channel on each socket and one PCI host per board that is connected at equal speed to each socket on the board.
The ibm,associativity property in each PCI host, CPU or memory device node consequently has an array of three (board, socket, core) integers:
memory at 0,0 { device_type = "memory"; reg = <0x0 0x0 0x4 0x0; /* board 0, socket 0, no specific core */ ibm,asssociativity = <0 0 0xffff>; }; memory at 4,0 { device_type = "memory"; reg = <0x4 0x0 0x4 0x0>; /* board 0, socket 1, no specific core */ ibm,asssociativity = <0 1 0xffff>; }; ... memory at 1c,0 { device_type = "memory"; reg = <0x1c 0x0 0x4 0x0>; /* board 0, socket 7, no specific core */ ibm,asssociativity = <1 7 0xffff>; }; cpus { #address-cells = <2>; #size-cells = <0>; cpu at 0 { device_type = "cpu"; reg = <0 0>; /* board 0, socket 0, core 0*/ ibm,asssociativity = <0 0 0>; }; cpu at 1 { device_type = "cpu"; reg = <0 0>; /* board 0, socket 0, core 0*/ ibm,asssociativity = <0 0 0>; }; ... cpu at 31 { device_type = "cpu"; reg = <0 32>; /* board 1, socket 7, core 31*/ ibm,asssociativity = <1 7 31>; }; }; pci at 100,0 { device_type = "pci"; /* board 0 */ ibm,associativity = <0 0xffff 0xffff>; ... }; pci at 200,0 { device_type = "pci"; /* board 1 */ ibm,associativity = <1 0xffff 0xffff>; ... }; ibm,associativity-reference-points = <0 1>;The "ibm,associativity-reference-points" property here indicates that index 2 of each array is the most important NUMA boundary for the particular system, because the performance impact of allocating memory on the remote board is more significant than the impact of using memory on a remote socket of the same board. Linux will consequently use the first field in the array as the NUMA node ID. If the link between the boards however is relatively fast, so you care mostly about allocating memory on the same socket, but going to another board isn't much worse than going to another socket on the same board, this would be
ibm,associativity-reference-points = <1 0>;so Linux would ignore the board ID and use the socket ID as the NUMA node number. The same would apply if you have only one (otherwise identical board, then you would get
Quoted 7 lines
ibm,associativity-reference-points = <1>;which means that index 0 is completely irrelevant for NUMA considerations and you just care about the socket ID. In this case, devices on the PCI bus would also not care about NUMA policy and just allocate buffers from anywhere, while in original example Linux would allocate DMA buffers only from the local board.
Thanks for the detail information. I have the concerns about the distance for NUMA nodes, does the "ibm,associativity-reference-points" property can represent the distance between NUMA nodes?
For example, a system with 4 sockets connected like below:
Socket 0 <----> Socket 1 <----> Socket 2 <----> Socket 3
So from socket 0 to socket 1 (maybe on the same board), it just need 1 jump to access the memory, but from socket 0 to socket 2/3, it needs 2/3 jumps and the *distance* relative longer. Can "ibm,associativity-reference-points" property cover this?
Thanks
Hanjun
RFC PATCH v2 2/4 Documentation: arm64/arm: dt bindings for numa.
Quoted 5 lines · On Wednesday 26 November 2014 17:12:49 Hanjun Guo wrote:
Thanks for the detail information. I have the concerns about the distance for NUMA nodes, does the "ibm,associativity-reference-points" property can represent the distance between NUMA nodes?
Quoted 9 lines
For example, a system with 4 sockets connected like below:
Socket 0 <----> Socket 1 <----> Socket 2 <----> Socket 3
So from socket 0 to socket 1 (maybe on the same board), it just need 1 jump to access the memory, but from socket 0 to socket 2/3, it needs 2/3 jumps and the *distance* relative longer. Can "ibm,associativity-reference-points" property cover this?
Hi Hanjun,
I only today found your replies in my spam folder, I need to put you on a whitelist so that doesn't happen again.
The above topology is not easy to represent, but I think it would work like this (ignoring the threads/cores/clusters on the socket, which would also need to be described in a full DT), using multiple logical paths between the nodes:
socket 0
ibm,associativity = <0 0 0 0>, <1 1 1 0>, <2 2 0 0>, <3 0 0 0>;
socket 1
ibm,associativity = <1 1 1 1>, <0 0 0 1>, <2 2 2 1>, <3 3 1 1>;
socket 2
ibm,associativity = <2 2 2 2>, <0 0 2 2>, <1 1 1 2>, <3 3 3 2>;
socket 3
ibm,associativity = <3 3 3 3>, <0 3 3 3>, <1 1 3 3>, <2 2 2 3>;
This describes four levels or hierarchy, with the lowest level being a single CPU core on one socket, and four paths between the sockets. To compute the associativity between two sockets, you need to look at each combination of paths to find the best match.
Comparing sockets 0 and 1, the best matches are <1 1 1 0> with <1 1 1 1>, and <0 0 0 0> with <0 0 0 1>. In each case, the associativity is "3", meaning the first three entries match.
Comparing sockets 0 and 3, we have four equally bad matches that each only match in the highest-level domain, e.g. <0 0 0 0> with <0 3 3 3>, so the associativity is only "1", and that means the two nodes are less closely associated than two neighboring ones.
With the algorithm that powerpc uses to turn associativity into distance, 2**(numlevels - associativity), this would put the distance of neighboring nodes at "2", and the longest distance at "8".
Arnd
RFC PATCH v2 2/4 Documentation: arm64/arm: dt bindings for numa.
Hi Arnd,
Quoted 16 lines · Arnd Bergmann
Quoted 5 lines · On Wednesday 26 November 2014 17:12:49 Hanjun Guo wrote:
Thanks for the detail information. I have the concerns about the distance for NUMA nodes, does the "ibm,associativity-reference-points" property can represent the distance between NUMA nodes?
Quoted 9 lines
For example, a system with 4 sockets connected like below:
Socket 0 <----> Socket 1 <----> Socket 2 <----> Socket 3
So from socket 0 to socket 1 (maybe on the same board), it just need 1 jump to access the memory, but from socket 0 to socket 2/3, it needs 2/3 jumps and the *distance* relative longer. Can "ibm,associativity-reference-points" property cover this?
Quoted 4 lines
Hi Hanjun,
I only today found your replies in my spam folder, I need to put you on a whitelist so that doesn't happen again.
Thanks. I hope my ACPI patches will not scare your email filter :)
Quoted 34 lines
The above topology is not easy to represent, but I think it would work like this (ignoring the threads/cores/clusters on the socket, which would also need to be described in a full DT), using multiple logical paths between the nodes:
socket 0
ibm,associativity = <0 0 0 0>, <1 1 1 0>, <2 2 0 0>, <3 0 0 0>;socket 1
ibm,associativity = <1 1 1 1>, <0 0 0 1>, <2 2 2 1>, <3 3 1 1>;socket 2
ibm,associativity = <2 2 2 2>, <0 0 2 2>, <1 1 1 2>, <3 3 3 2>;socket 3
ibm,associativity = <3 3 3 3>, <0 3 3 3>, <1 1 3 3>, <2 2 2 3>;This describes four levels or hierarchy, with the lowest level being a single CPU core on one socket, and four paths between the sockets. To compute the associativity between two sockets, you need to look at each combination of paths to find the best match.
Comparing sockets 0 and 1, the best matches are <1 1 1 0> with <1 1 1 1>, and <0 0 0 0> with <0 0 0 1>. In each case, the associativity is "3", meaning the first three entries match.
Comparing sockets 0 and 3, we have four equally bad matches that each only match in the highest-level domain, e.g. <0 0 0 0> with <0 3 3 3>, so the associativity is only "1", and that means the two nodes are less closely associated than two neighboring ones.
Quoted 4 lines
With the algorithm that powerpc uses to turn associativity into distance, 2**(numlevels - associativity), this would put the distance of neighboring nodes at "2", and the longest distance at "8".
Thanks for the explain, I can understand how it works now, a bit complicated for me and I think the distance property "node-matrix" in Ganapatrao's patch is straight forward, what do you think?
Thanks
Hanjun
RFC PATCH v2 2/4 Documentation: arm64/arm: dt bindings for numa.
Quoted 40 lines · On Thursday 11 December 2014 17:16:35 Hanjun Guo wrote:
Quoted 34 lines · Arnd Bergmann
On Wednesday 26 November 2014 17:12:49 Hanjun Guo wrote:
The above topology is not easy to represent, but I think it would work like this (ignoring the threads/cores/clusters on the socket, which would also need to be described in a full DT), using multiple logical paths between the nodes:socket 0
ibm,associativity = <0 0 0 0>, <1 1 1 0>, <2 2 0 0>, 0 0 0>;socket 1
ibm,associativity = <1 1 1 1>, <0 0 0 1>, <2 2 2 1>, 3 1 1>;socket 2
ibm,associativity = <2 2 2 2>, <0 0 2 2>, <1 1 1 2>, 3 3 2>;socket 3
ibm,associativity = 3 3 3>, <0 3 3 3>, <1 1 3 3>, <2 2 2 3>;This describes four levels or hierarchy, with the lowest level being a single CPU core on one socket, and four paths between the sockets. To compute the associativity between two sockets, you need to look at each combination of paths to find the best match.
Comparing sockets 0 and 1, the best matches are <1 1 1 0> with <1 1 1 1>, and <0 0 0 0> with <0 0 0 1>. In each case, the associativity is "3", meaning the first three entries match.
Comparing sockets 0 and 3, we have four equally bad matches that each only match in the highest-level domain, e.g. <0 0 0 0> with <0 3 3 3>, so the associativity is only "1", and that means the two nodes are less closely associated than two neighboring ones.
Quoted 4 lines
With the algorithm that powerpc uses to turn associativity into distance, 2**(numlevels - associativity), this would put the distance of neighboring nodes at "2", and the longest distance at "8".
Quoted 4 lines
Thanks for the explain, I can understand how it works now, a bit complicated for me and I think the distance property "node-matrix" in Ganapatrao's patch is straight forward, what do you think?
I still think we should go the whole way of having something compatible with the existing bindings, possibly using different property names if there are objections to using the "ibm," prefix.
The associativity property is more expressive and lets you describe things that you can't describe with the mem-map/cpu-map properties, e.g. devices that are part of the NUMA hierarchy but not associated to exactly one last-level node.
Arnd
RFC PATCH v2 2/4 Documentation: arm64/arm: dt bindings for numa.
Quoted 41 lines · Arnd Bergmann
Quoted 40 lines · On Thursday 11 December 2014 17:16:35 Hanjun Guo wrote:
Quoted 38 lines · Arnd Bergmann
On Wednesday 26 November 2014 17:12:49 Hanjun Guo wrote:
The above topology is not easy to represent, but I think it would work like this (ignoring the threads/cores/clusters on the socket, which would also need to be described in a full DT), using multiple logical paths between the nodes:socket 0
ibm,associativity = <0 0 0 0>, <1 1 1 0>, <2 2 0 0>, 0 0 0>;socket 1
ibm,associativity = <1 1 1 1>, <0 0 0 1>, <2 2 2 1>, 3 1 1>;socket 2
ibm,associativity = <2 2 2 2>, <0 0 2 2>, <1 1 1 2>, 3 3 2>;socket 3
ibm,associativity = 3 3 3>, <0 3 3 3>, <1 1 3 3>, <2 2 2 3>;This describes four levels or hierarchy, with the lowest level being a single CPU core on one socket, and four paths between the sockets. To compute the associativity between two sockets, you need to look at each combination of paths to find the best match.
Comparing sockets 0 and 1, the best matches are <1 1 1 0> with <1 1 1 1>, and <0 0 0 0> with <0 0 0 1>. In each case, the associativity is "3", meaning the first three entries match.
Comparing sockets 0 and 3, we have four equally bad matches that each only match in the highest-level domain, e.g. <0 0 0 0> with <0 3 3 3>, so the associativity is only "1", and that means the two nodes are less closely associated than two neighboring ones.
With the algorithm that powerpc uses to turn associativity into distance, 2**(numlevels - associativity), this would put the distance of neighboring nodes at "2", and the longest distance at "8".
Quoted 8 lines
Quoted 4 lines
Thanks for the explain, I can understand how it works now, a bit complicated for me and I think the distance property "node-matrix" in Ganapatrao's patch is straight forward, what do you think?
I still think we should go the whole way of having something compatible with the existing bindings, possibly using different property names if there are objections to using the "ibm," prefix.
I agree that we should keep using existing bindings and not introducing a new one.
Thanks
Hanjun
RFC PATCH v2 2/4 Documentation: arm64/arm: dt bindings for numa.
In reply to Arnd BergmannHi Arnd,
Quoted 14 lines · Arnd Bergmann
Quoted 6 lines · On Tuesday 25 November 2014 08:15:47 Ganapatrao Kulkarni wrote:
Quoted 5 lines
No, don't hardcode ARM specifics into a common binding either. I've looked at the ibm,associativity properties again, and I think we should just use those, they can cover all cases and are completely independent of the architecture. We should probably discuss about the property name though, as using the "ibm," prefix might not be the best idea.
Quoted 6 lines
We have started with new proposal, since not got enough details how ibm/ppc is managing the numa using dt.
there is no documentation and there is no power/PAPR spec for numa in public domain and there are no single dt file inarch/powerpcwhich describes the numa. if we get any one of these details, we can align to powerpc implementation.
Quoted 7 lines
Basically the idea is to have an "ibm,associativity" property in each bus or device that is node specific, and this includes all CPUs and memory nodes. The property contains an array of 32-bit integers that count the resources. Take an example of a NUMA cluster of two machines with four sockets and four cores each (32 cores total), a memory channel on each socket and one PCI host per board that is connected at equal speed to each socket on the board.
thanks for the detailed information.
IMHO, linux-numa code does not care about how the hardware design is, like how many boards and how many sockets it has. It only needs to know how many numa nodes system has, how resources are mapped to nodes and node-distance to define inter node memory access latency. i think it will be simple, if we merge board and socket to single entry say node.
also we are assuming here that numa h/w design will have multiple boards and sockets, what if it has something different/more.
Quoted 80 lines
The ibm,associativity property in each PCI host, CPU or memory device node consequently has an array of three (board, socket, core) integers:
memory at 0,0 { device_type = "memory"; reg = <0x0 0x0 0x4 0x0; /* board 0, socket 0, no specific core */ ibm,asssociativity = <0 0 0xffff>; }; memory at 4,0 { device_type = "memory"; reg = <0x4 0x0 0x4 0x0>; /* board 0, socket 1, no specific core */ ibm,asssociativity = <0 1 0xffff>; }; ... memory at 1c,0 { device_type = "memory"; reg = <0x1c 0x0 0x4 0x0>; /* board 0, socket 7, no specific core */ ibm,asssociativity = <1 7 0xffff>; }; cpus { #address-cells = <2>; #size-cells = <0>; cpu at 0 { device_type = "cpu"; reg = <0 0>; /* board 0, socket 0, core 0*/ ibm,asssociativity = <0 0 0>; }; cpu at 1 { device_type = "cpu"; reg = <0 0>; /* board 0, socket 0, core 0*/ ibm,asssociativity = <0 0 0>; }; ... cpu at 31 { device_type = "cpu"; reg = <0 32>; /* board 1, socket 7, core 31*/ ibm,asssociativity = <1 7 31>; }; }; pci at 100,0 { device_type = "pci"; /* board 0 */ ibm,associativity = <0 0xffff 0xffff>; ... }; pci at 200,0 { device_type = "pci"; /* board 1 */ ibm,associativity = <1 0xffff 0xffff>; ... }; ibm,associativity-reference-points = <0 1>;The "ibm,associativity-reference-points" property here indicates that index 2 of each array is the most important NUMA boundary for the particular system, because the performance impact of allocating memory on the remote board is more significant than the impact of using memory on a remote socket of the same board. Linux will consequently use the first field in the array as the NUMA node ID. If the link between the boards however is relatively fast, so you care mostly about allocating memory on the same socket, but going to another board isn't much worse than going to another socket on the same board, this would be
Quoted 1 line
ibm,associativity-reference-points = <1 0>;
i am not able to understand fully, it will be grate help, if you explain, how we capture the node distance matrix using "ibm,associativity-reference-points "
for example, how DT looks like for the system with 4 nodes, with below inter-node distance matrix.
node 0 1 distance 20
node 0 2 distance 20
node 0 3 distance 20
node 1 2 distance 20
node 1 3 distance 20
node 2 3 distance 20
Quoted 7 lines
so Linux would ignore the board ID and use the socket ID as the NUMA node number. The same would apply if you have only one (otherwise identical board, then you would get
ibm,associativity-reference-points = <1>;
Quoted 7 lines
which means that index 0 is completely irrelevant for NUMA considerations and you just care about the socket ID. In this case, devices on the PCI bus would also not care about NUMA policy and just allocate buffers from anywhere, while in original example Linux would allocate DMA buffers only from the local board.
Arnd
thanks
ganapat
ps: sorry for the delayed reply.
RFC PATCH v2 2/4 Documentation: arm64/arm: dt bindings for numa.
Quoted 22 lines · On Sunday 30 November 2014 08:38:02 Ganapatrao Kulkarni wrote:
Quoted 14 lines · Arnd Bergmann
Quoted 6 lines · On Tuesday 25 November 2014 08:15:47 Ganapatrao Kulkarni wrote:
Quoted 5 lines
No, don't hardcode ARM specifics into a common binding either. I've looked at the ibm,associativity properties again, and I think we should just use those, they can cover all cases and are completely independent of the architecture. We should probably discuss about the property name though, as using the "ibm," prefix might not be the best idea.
Quoted 6 lines
We have started with new proposal, since not got enough details how ibm/ppc is managing the numa using dt.
there is no documentation and there is no power/PAPR spec for numa in public domain and there are no single dt file inarch/powerpcwhich describes the numa. if we get any one of these details, we can align to powerpc implementation.Quoted 7 lines
Basically the idea is to have an "ibm,associativity" property in each bus or device that is node specific, and this includes all CPUs and memory nodes. The property contains an array of 32-bit integers that count the resources. Take an example of a NUMA cluster of two machines with four sockets and four cores each (32 cores total), a memory channel on each socket and one PCI host per board that is connected at equal speed to each socket on the board.
Quoted 7 lines
thanks for the detailed information.
IMHO, linux-numa code does not care about how the hardware design is, like how many boards and how many sockets it has. It only needs to know how many numa nodes system has, how resources are mapped to nodes and node-distance to define inter node memory access latency. i think it will be simple, if we merge board and socket to single entry say node.
But it's not good to rely on implementation details of a particular operating system.
Quoted 2 lines
also we are assuming here that numa h/w design will have multiple boards and sockets, what if it has something different/more.
As I said, this was a simplified example, you can have an arbitrary number of levels, and normally there are more than three, to capture the cache hierarchy and other things as well.
Quoted 11 lines
Quoted 11 lines
The "ibm,associativity-reference-points" property here indicates that index 2 of each array is the most important NUMA boundary for the particular system, because the performance impact of allocating memory on the remote board is more significant than the impact of using memory on a remote socket of the same board. Linux will consequently use the first field in the array as the NUMA node ID. If the link between the boards however is relatively fast, so you care mostly about allocating memory on the same socket, but going to another board isn't much worse than going to another socket on the same board, this would be
ibm,associativity-reference-points = <1 0>;
Quoted 11 lines
i am not able to understand fully, it will be grate help, if you explain, how we capture the node distance matrix using "ibm,associativity-reference-points "
for example, how DT looks like for the system with 4 nodes, with below inter-node distance matrix.
node 0 1 distance 20
node 0 2 distance 20
node 0 3 distance 20
node 1 2 distance 20
node 1 3 distance 20
node 2 3 distance 20
In your example, you have only one entry in ibm,associativity-reference-points as it's even simpler: just one level of hierarchy, everything is the same distance from everything else, so within the associativity hierarchy, the ibm,associativity-reference-points just points to the one level that indicates a NUMA node.
You would only need multiple entries here if the hierarchy is complex enough to require multiple levels of topology.
Arnd
RFC PATCH v2 2/4 Documentation: arm64/arm: dt bindings for numa.
In reply to Arnd BergmannHi Arnd,
Quoted 45 lines · Arnd Bergmann
Quoted 37 lines · On Tuesday 25 November 2014 17:42:44 Hanjun Guo wrote:
Quoted 3 lines · Shannon Zhao
Hi,
On 2014/11/22 5:23, Ganapatrao Kulkarni wrote:
[...]
Quoted 21 lines
Quoted 5 lines
+==============================================================================
+4 - Example dts
+==============================================================================Documentation/devicetree/bindings/arm/numa.txt new file +2
-0+ +Example 1: 2 Node system each having 8 CPUs and a Memory.Documentation/devicetree/bindings/arm/numa.txt line 63
Quoted 10 lines
Documentation/devicetree/bindings/arm/numa.txt new file +10
-0+ + numa-map { + #address-cells = <2>; + #size-cells = <1>; + #node-count = <2>; + mem-map = <0x0 0x00000000 0>, + <0x100 0x00000000 1>; + + cpu-map = <0 7 0>, + <8 15 1>;The cpu range is continuous here. But if there is a situation like below:
0 2 4 6 belong to node 0
1 3 5 7 belong to node 1Quoted 7 lines
This case is very common on X86. I don't know the real situation of arm as I don't have a hardware with 2 nodes.
How can we generate a DTS about this situation? like below? Can be parsed?
cpu-map = <0 2 4 6 0>, <1 3 5 7 1>;I think the binding proposed here can not cover your needs, and I think this binding is not suitable, there are some reasons.
Quoted 6 lines
- CPU logical ID is allocated by OS, and it depends on the order of CPU node in the device tree, so it may be in a clean order like this patch proposed, or it will like the order Shannon pointed out.
- Since CPU logical ID is allocated by OS, DTS file will not know these numbers.
Quoted 7 lines
Also:
- you cannot support hierarchical NUMA topology
- you cannot have CPU-less or memory-less nodes
- you cannot associate I/O devices with NUMA nodes, only memory and CPU
Yes, I agree.
Quoted 6 lines
Quoted 6 lines
So the problem behind this is the mappings between CPUs and NUMA nodes, there is already mapping for CPU hardware ID (MPIDR) and CPU logical ID, and MPIDR will be not changed, why not using MPIDR for the mapping of NUMA node and CPU? then the mappings will be:
Quoted 8 lines
Quoted 2 lines
CPU logical ID <------> CPU MPIDR <-----> NUMA node ID <-----> proximity domain
(allocated by OS) (constant) (allocated by OS)No, don't hardcode ARM specifics into a common binding either. I've looked at the ibm,associativity properties again, and I think we should just use those, they can cover all cases and are completely independent of the architecture. We should probably discuss about the property name though, as using the "ibm," prefix might not be the best idea.
Is there any doc/code related to this? please give me some hints and I will read that.
Thanks
Hanjun
RFC PATCH v2 2/4 Documentation: arm64/arm: dt bindings for numa.
In reply to Arnd BergmannQuoted 58 lines · Arnd Bergmann
Quoted 37 lines · On Tuesday 25 November 2014 17:42:44 Hanjun Guo wrote:
Quoted 3 lines · Shannon Zhao
Hi,
On 2014/11/22 5:23, Ganapatrao Kulkarni wrote:
[...]
Quoted 21 lines
Quoted 5 lines
+==============================================================================
+4 - Example dts
+==============================================================================Documentation/devicetree/bindings/arm/numa.txt new file +2
-0+ +Example 1: 2 Node system each having 8 CPUs and a Memory.Documentation/devicetree/bindings/arm/numa.txt line 63
Quoted 10 lines
Documentation/devicetree/bindings/arm/numa.txt new file +10
-0+ + numa-map { + #address-cells = <2>; + #size-cells = <1>; + #node-count = <2>; + mem-map = <0x0 0x00000000 0>, + <0x100 0x00000000 1>; + + cpu-map = <0 7 0>, + <8 15 1>;The cpu range is continuous here. But if there is a situation like below:
0 2 4 6 belong to node 0
1 3 5 7 belong to node 1Quoted 7 lines
This case is very common on X86. I don't know the real situation of arm as I don't have a hardware with 2 nodes.
How can we generate a DTS about this situation? like below? Can be parsed?
cpu-map = <0 2 4 6 0>, <1 3 5 7 1>;I think the binding proposed here can not cover your needs, and I think this binding is not suitable, there are some reasons.
Quoted 6 lines
- CPU logical ID is allocated by OS, and it depends on the order of CPU node in the device tree, so it may be in a clean order like this patch proposed, or it will like the order Shannon pointed out.
- Since CPU logical ID is allocated by OS, DTS file will not know these numbers.
Also:
- you cannot support hierarchical NUMA topology
- you cannot have CPU-less or memory-less nodes
- you cannot associate I/O devices with NUMA nodes, only memory and CPU
Quoted 5 lines
So the problem behind this is the mappings between CPUs and NUMA nodes, there is already mapping for CPU hardware ID (MPIDR) and CPU logical ID, and MPIDR will be not changed, why not using MPIDR for the mapping of NUMA node and CPU? then the mappings will be:
Quoted 9 lines
Quoted 2 lines
CPU logical ID <------> CPU MPIDR <-----> NUMA node ID <-----> proximity domain
(allocated by OS) (constant) (allocated by OS)No, don't hardcode ARM specifics into a common binding either. I've looked at the ibm,associativity properties again, and I think we should just use those, they can cover all cases and are completely independent of the architecture. We should probably discuss about the property name though, as using the "ibm," prefix might not be the best idea.
Yeah, I have read the relevant codes in qemu. I think the "ibm,associativity" is more scalable:-)
About the prefix, my opinion is that as this is relevant with NUMA, maybe we can use "numa" as the prefix.
Thanks,
Shannon
RFC PATCH v2 2/4 Documentation: arm64/arm: dt bindings for numa.
Quoted 9 lines · On Wednesday 26 November 2014 10:29:01 Shannon Zhao wrote:
Quoted 6 lines · Arnd Bergmann
No, don't hardcode ARM specifics into a common binding either. I've looked at the ibm,associativity properties again, and I think we should just use those, they can cover all cases and are completely independent of the architecture. We should probably discuss about the property name though, as using the "ibm," prefix might not be the best idea.
Yeah, I have read the relevant codes in qemu. I think the "ibm,associativity" is more scalable:-)
Ok
Quoted 2 lines
About the prefix, my opinion is that as this is relevant with NUMA, maybe we can use "numa" as the prefix.
A prefix should really be the name of a company or institution, so it could be "arm" or "linux", but not "numa". Would could use "numa-associativity" with a dash instead of a comma, but that would still be somewhat imprecise because the associativity property is about system topology inside of a NUMA domain as well, such as cores, core clusters or SMT threads that only share caches but not physical memory addresses.
Arnd
RFC PATCH v2 3/4 arm64:thunder: Add initial dts for Cavium's Thunder SoC in 2 Node topology.
In reply to Ganapatrao Kulkarniadding devicetree definition for Cavium's Thunder SoC in 2 Node topology.
--- arch/arm64/boot/dts/thunder-88xx-2n.dts | 88 ++++ arch/arm64/boot/dts/thunder-88xx-2n.dtsi | 694 +++++++++++++++++++++++++++++++ 2 files changed, 782 insertions(+) create mode 100644 arch/arm64/boot/dts/thunder-88xx-2n.dts create mode 100644 arch/arm64/boot/dts/thunder-88xx-2n.dtsi
arch/arm64/boot/dts/thunder-88xx-2n.dts new file +88 -0
@@ -0,0 +1,88 @@ +/* + * Cavium Thunder DTS file - Thunder board description + * + * Copyright (C) 2014, Cavium Inc. + * + * This file is dual-licensed: you can use it either under the terms + * of the GPL or the X11 license, at your option. Note that this dual + * licensing only applies to this file, and not this project as a + * whole. + * + * a) This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * Or, alternatively, + * + * b) Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +/dts-v1/; + +/include/ "thunder-88xx-2n.dtsi" + +/ { + model = "Cavium ThunderX CN88XX board"; + compatible = "cavium,thunder-88xx"; + + aliases { + serial0 = &uaa0; + serial1 = &uaa1; + }; + + memory at 00c00000 { + device_type = "memory"; + reg = <0x0 0x00000000 0x0 0x80000000>; + }; + + memory at 10000000000 { + device_type = "memory"; + reg = <0x100 0x00000000 0x0 0x80000000>; + }; + + numa-map { + #address-cells = <2>; + #size-cells = <1>; + #node-count = <2>; + mem-map = <0x0 0x00000000 0>, + <0x100 0x00000000 1>; + + cpu-map = <0 47 0>, + <48 95 1>; + + node-matrix= <0 0 10>, + <0 1 20>, + <1 0 20>, + <1 1 10>; + }; +};
arch/arm64/boot/dts/thunder-88xx-2n.dtsi new file +694 -0
694 lines not on this page · raw message
Signature · 1 line
1.8.1.4
RFC PATCH v2 3/4 arm64:thunder: Add initial dts for Cavium's Thunder SoC in 2 Node topology.
arch/arm64/boot/dts/thunder-88xx-2n.dts line 56
Quoted 3 lines · On Saturday 22 November 2014 02:53:29 Ganapatrao Kulkarni wrote:
arch/arm64/boot/dts/thunder-88xx-2n.dts new file +3
-0+/ { + model = "Cavium ThunderX CN88XX board"; + compatible = "cavium,thunder-88xx";
No wildcards in compatible strings or model names please. List the exact chip that you are using.
Quoted 19 lines
arch/arm64/boot/dts/thunder-88xx-2n.dts new file +19
-0+ aliases { + serial0 = &uaa0; + serial1 = &uaa1; + }; + + memory at 00c00000 { + device_type = "memory"; + reg = <0x0 0x00000000 0x0 0x80000000>; + }; + + memory at 10000000000 { + device_type = "memory"; + reg = <0x100 0x00000000 0x0 0x80000000>; + }; + + numa-map { + #address-cells = <2>; + #size-cells = <1>; + #node-count = <2>;
arch/arm64/boot/dts/thunder-88xx-2n.dts line 86
Quoted 10 lines
arch/arm64/boot/dts/thunder-88xx-2n.dts new file +10
-0+ mem-map = <0x0 0x00000000 0>, + <0x100 0x00000000 1>; + + cpu-map = <0 47 0>, + <48 95 1>; + + node-matrix= <0 0 10>, + <0 1 20>, + <1 0 20>, + <1 1 10>;
I don't know how much history is behind this binding. Have you looked at the sPAPR way of doing this? I don't remember exactly how that is done, but we'd need a good reason to discard that and implement something else for arm64.
If we create a new binding, I don't think the 'numa-map' node you have here is the best solution. We already have device nodes for each memory segment and each CPU in the system. Why not work with those nodes directly?
Quoted 11 lines
arch/arm64/boot/dts/thunder-88xx-2n.dtsi new file +11
-0+ + timer { + compatible = "arm,armv8-timer"; + interrupts = <1 13 0xff01>, + <1 14 0xff01>, + <1 11 0xff01>, + <1 10 0xff01>; + }; + + soc { + compatible = "simple-bus";
arch/arm64/boot/dts/thunder-88xx-2n.dtsi line 662
Quoted 10 lines
arch/arm64/boot/dts/thunder-88xx-2n.dtsi new file +10
-0+ #address-cells = <2>; + #size-cells = <2>; + ranges; + + refclk50mhz: refclk50mhz { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <50000000>; + clock-output-names = "refclk50mhz"; + };
Why is the timer outside of the soc and the refclk is inside? I would have expected the opposite.
Arnd
RFC PATCH v2 3/4 arm64:thunder: Add initial dts for Cavium's Thunder SoC in 2 Node topology.
Quoted 43 lines · Arnd Bergmann
arch/arm64/boot/dts/thunder-88xx-2n.dts line 56
Quoted 3 lines · On Saturday 22 November 2014 02:53:29 Ganapatrao Kulkarni wrote:
arch/arm64/boot/dts/thunder-88xx-2n.dts new file +3
-0+/ { + model = "Cavium ThunderX CN88XX board"; + compatible = "cavium,thunder-88xx";No wildcards in compatible strings or model names please. List the exact chip that you are using.
Quoted 19 lines
arch/arm64/boot/dts/thunder-88xx-2n.dts new file +19
-0+ aliases { + serial0 = &uaa0; + serial1 = &uaa1; + }; + + memory at 00c00000 { + device_type = "memory"; + reg = <0x0 0x00000000 0x0 0x80000000>; + }; + + memory at 10000000000 { + device_type = "memory"; + reg = <0x100 0x00000000 0x0 0x80000000>; + }; + + numa-map { + #address-cells = <2>; + #size-cells = <1>; + #node-count = <2>;arch/arm64/boot/dts/thunder-88xx-2n.dts line 86
Quoted 10 lines
arch/arm64/boot/dts/thunder-88xx-2n.dts new file +10
-0+ mem-map = <0x0 0x00000000 0>, + <0x100 0x00000000 1>; + + cpu-map = <0 47 0>, + <48 95 1>; + + node-matrix= <0 0 10>, + <0 1 20>, + <1 0 20>, + <1 1 10>;I don't know how much history is behind this binding. Have you looked at the sPAPR way of doing this? I don't remember exactly how that is done, but we'd need a good reason to discard that and implement something else for arm64.
Quoted 4 lines
If we create a new binding, I don't think the 'numa-map' node you have here is the best solution. We already have device nodes for each memory segment and each CPU in the system. Why not work with those nodes directly?
The DT memory nodes don't exist in an EFI system, as the EFI memory map is used instead.
Using EFI as the boot firmware doesn't require the use of ACPI for hardware description,
so the EFI/DT case is one that we should support.
Quoted 27 lines
Quoted 11 lines
arch/arm64/boot/dts/thunder-88xx-2n.dtsi new file +11
-0+ + timer { + compatible = "arm,armv8-timer"; + interrupts = <1 13 0xff01>, + <1 14 0xff01>, + <1 11 0xff01>, + <1 10 0xff01>; + }; + + soc { + compatible = "simple-bus";arch/arm64/boot/dts/thunder-88xx-2n.dtsi line 662
Quoted 10 lines
arch/arm64/boot/dts/thunder-88xx-2n.dtsi new file +10
-0+ #address-cells = <2>; + #size-cells = <2>; + ranges; + + refclk50mhz: refclk50mhz { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <50000000>; + clock-output-names = "refclk50mhz"; + };Why is the timer outside of the soc and the refclk is inside? I would have expected the opposite.
Arnd
RFC PATCH v2 3/4 arm64:thunder: Add initial dts for Cavium's Thunder SoC in 2 Node topology.
Quoted 11 lines · On Monday 24 November 2014 11:32:46 Roy Franz wrote:
Quoted 10 lines
I don't know how much history is behind this binding. Have you looked at the sPAPR way of doing this? I don't remember exactly how that is done, but we'd need a good reason to discard that and implement something else for arm64.
If we create a new binding, I don't think the 'numa-map' node you have here is the best solution. We already have device nodes for each memory segment and each CPU in the system. Why not work with those nodes directly?
Quoted 5 lines
The DT memory nodes don't exist in an EFI system, as the EFI memory map is used instead.
Using EFI as the boot firmware doesn't require the use of ACPI for hardware description,
so the EFI/DT case is one that we should support.
But they /could/ exist, right? Can we just require them to be present in order to use NUMA features?
I don't think it's a good idea to require a new representation of the memory nodes in DT to make NUMA work when we already have one that is almost always there.
Arnd
RFC PATCH v2 3/4 arm64:thunder: Add initial dts for Cavium's Thunder SoC in 2 Node topology.
Quoted 12 lines · Arnd Bergmann
Quoted 11 lines · On Monday 24 November 2014 11:32:46 Roy Franz wrote:
Quoted 10 lines
I don't know how much history is behind this binding. Have you looked at the sPAPR way of doing this? I don't remember exactly how that is done, but we'd need a good reason to discard that and implement something else for arm64.
If we create a new binding, I don't think the 'numa-map' node you have here is the best solution. We already have device nodes for each memory segment and each CPU in the system. Why not work with those nodes directly?
Quoted 9 lines
Quoted 5 lines
The DT memory nodes don't exist in an EFI system, as the EFI memory map is used instead.
Using EFI as the boot firmware doesn't require the use of ACPI for hardware description,
so the EFI/DT case is one that we should support.But they /could/ exist, right? Can we just require them to be present in order to use NUMA features?
Actually, currently the memory nodes are stripped from the device tree by the EFI stub, so the kernel will never get to see them. This is done more or less as a fixup, under the assumption that EFI systems should not have DT memory nodes in the first place.
We could revisit this, of course, but it needs to be taken into account in this discussion.
Signature · 1 line
Ard.
RFC PATCH v2 3/4 arm64:thunder: Add initial dts for Cavium's Thunder SoC in 2 Node topology.
Quoted 23 lines · On Tuesday 25 November 2014 13:38:01 Ard Biesheuvel wrote:
Quoted 12 lines · Arnd Bergmann
Quoted 11 lines · On Monday 24 November 2014 11:32:46 Roy Franz wrote:
Quoted 10 lines
I don't know how much history is behind this binding. Have you looked at the sPAPR way of doing this? I don't remember exactly how that is done, but we'd need a good reason to discard that and implement something else for arm64.
If we create a new binding, I don't think the 'numa-map' node you have here is the best solution. We already have device nodes for each memory segment and each CPU in the system. Why not work with those nodes directly?
Quoted 9 lines
Quoted 5 lines
The DT memory nodes don't exist in an EFI system, as the EFI memory map is used instead.
Using EFI as the boot firmware doesn't require the use of ACPI for hardware description,
so the EFI/DT case is one that we should support.But they /could/ exist, right? Can we just require them to be present in order to use NUMA features?
Quoted 7 lines
Actually, currently the memory nodes are stripped from the device tree by the EFI stub, so the kernel will never get to see them. This is done more or less as a fixup, under the assumption that EFI systems should not have DT memory nodes in the first place.
We could revisit this, of course, but it needs to be taken into account in this discussion.
Right. As we don't support NUMA yet, this would have to become a requirement for implementing NUMA: If you have no memory nodes, you could still use the DT binding for topology, but it would be limited to CPUs and I/O devices, which of course seriously limits the usefulness.
Arnd
RFC PATCH v2 3/4 arm64:thunder: Add initial dts for Cavium's Thunder SoC in 2 Node topology.
In reply to Ganapatrao KulkarniQuoted 10 lines · Ganapatrao Kulkarni
adding devicetree definition for Cavium's Thunder SoC in 2 Node topology.
Signed-off-by Ganapatrao Kulkarni <[email protected]>--- arch/arm64/boot/dts/thunder-88xx-2n.dts | 88 ++++ arch/arm64/boot/dts/thunder-88xx-2n.dtsi | 694 +++++++++++++++++++++++++++++++ 2 files changed, 782 insertions(+) create mode 100644 arch/arm64/boot/dts/thunder-88xx-2n.dts create mode 100644 arch/arm64/boot/dts/thunder-88xx-2n.dtsi
[...]
Quoted 5 lines
arch/arm64/boot/dts/thunder-88xx-2n.dtsi new file +0
-0
[...]
arch/arm64/boot/dts/thunder-88xx-2n.dtsi line 649
Quoted 7 lines
arch/arm64/boot/dts/thunder-88xx-2n.dtsi new file +7
-0+ timer { + compatible = "arm,armv8-timer"; + interrupts = <1 13 0xff01>, + <1 14 0xff01>, + <1 11 0xff01>, + <1 10 0xff01>; + };
These "0xff01" cells are bogus (the GICv3 binding only specifies values 1 and 4 for respectively edge and level triggered). My hunch is that they should be 4, as the timers are likely to be level triggered.
Quoted 17 lines
arch/arm64/boot/dts/thunder-88xx-2n.dtsi new file +17
-0+ + soc { + compatible = "simple-bus"; + #address-cells = <2>; + #size-cells = <2>; + ranges; + + refclk50mhz: refclk50mhz { + compatible = "fixed-clock"; + #clock-cells = <0>; + clock-frequency = <50000000>; + clock-output-names = "refclk50mhz"; + }; + + gic0: interrupt-controller at 8010,00000000 { + compatible = "arm,gic-v3"; + #interrupt-cells = <3>;
arch/arm64/boot/dts/thunder-88xx-2n.dtsi line 676
Quoted 10 lines
arch/arm64/boot/dts/thunder-88xx-2n.dtsi new file +10
-0+ #address-cells = <2>; + #size-cells = <2>; + #redistributor-regions = <2>; + ranges; + interrupt-controller; + reg = <0x8010 0x00000000 0x0 0x010000>, /* GICD */ + <0x8010 0x80000000 0x0 0x600000>, /* GICR Node 0 */ + <0x9010 0x80000000 0x0 0x600000>; /* GICR Node 1 */ + interrupts = <1 9 0xf04>; + };
Same here.
Thanks,
M.
Signature · 1 line
Jazz is not dead. It just smells funny...
RFC PATCH v2 4/4 arm64:numa: adding numa support for arm64 platforms.
In reply to Ganapatrao KulkarniAdding numa support for arm64 based platforms. creating numa mapping by parsing the dt node numa-map.
--- arch/arm64/Kconfig | 33 +++ arch/arm64/include/asm/mmzone.h | 32 ++ arch/arm64/include/asm/numa.h | 35 +++ arch/arm64/kernel/setup.c | 8 + arch/arm64/kernel/smp.c | 2 + arch/arm64/mm/Makefile | 1 + arch/arm64/mm/init.c | 34 ++- arch/arm64/mm/numa.c | 631 ++++++++++++++++++++++++++++++++++++++++ 8 files changed, 770 insertions(+), 6 deletions(-) create mode 100644 arch/arm64/include/asm/mmzone.h create mode 100644 arch/arm64/include/asm/numa.h create mode 100644 arch/arm64/mm/numa.c
arch/arm64/Kconfig +33 -0
@@ -59,6 +59,7 @@ config ARM64 select HAVE_PERF_USER_STACK_DUMP select HAVE_RCU_TABLE_FREE select HAVE_SYSCALL_TRACEPOINTS + select HAVE_MEMBLOCK_NODE_MAP if NUMA select IRQ_DOMAIN select MODULES_USE_ELF_RELA select NO_BOOTMEM
@@ -315,6 +316,38 @@ config HOTPLUG_CPU Say Y here to experiment with turning CPUs off and on. CPUs can be controlled through /sys/devices/system/cpu. +# Common NUMA Features +config NUMA + bool "Numa Memory Allocation and Scheduler Support" + depends on SMP + ---help--- + Enable NUMA (Non Uniform Memory Access) support. + + The kernel will try to allocate memory used by a CPU on the + local memory controller of the CPU and add some more + NUMA awareness to the kernel. + +config ARM64_DT_NUMA + def_bool y + prompt "DT NUMA detection" + default n + ---help--- + Enable DT based numa. + +config NODES_SHIFT + int "Maximum NUMA Nodes (as a power of 2)" + range 1 10 + default "2" + depends on NEED_MULTIPLE_NODES + ---help--- + Specify the maximum number of NUMA Nodes available on the target + system. Increases memory reserved to accommodate various tables. + +config USE_PERCPU_NUMA_NODE_ID + def_bool y + depends on NUMA + + source kernel/Kconfig.preempt config HZ
arch/arm64/include/asm/mmzone.h new file +32 -0
@@ -0,0 +1,32 @@ +#ifndef __ASM_ARM64_MMZONE_H_ +#define __ASM_ARM64_MMZONE_H_ + +#ifdef CONFIG_NUMA + +#include <linux/mmdebug.h> +#include <asm/smp.h> +#include <linux/types.h> +#include <asm/numa.h> + +extern struct pglist_data *node_data[]; + +#define NODE_DATA (nid) (node_data[nid]) + + +struct numa_memblk { +u64 start; +u64 end; +int nid; +}; + +struct numa_meminfo { +int nr_blks; +struct numa_memblk blk[NR_NODE_MEMBLKS ]; +}; + +void __init numa_remove_memblk_from (int idx,struct numa_meminfo *mi); +int __init numa_cleanup_meminfo (struct numa_meminfo *mi); +void __init numa_reset_distance (void ); + +#endif /* CONFIG_NUMA */ +#endif /* __ASM_ARM64_MMZONE_H_ */
arch/arm64/include/asm/numa.h new file +35 -0
@@ -0,0 +1,35 @@ +#ifndef _ASM_ARM64_NUMA_H +#define _ASM_ARM64_NUMA_H + +#include <linux/nodemask.h> +#include <asm/topology.h> + +#ifdef CONFIG_NUMA + +#define NR_NODE_MEMBLKS (MAX_NUMNODES * 2) +#define ZONE_ALIGN (1UL << (MAX_ORDER + PAGE_SHIFT)) + +/* currently, arm64 implements flat NUMA topology */ +#define parent_node (node) (node) + +/* dummy definitions for pci functions */ +#define pcibus_to_node (node) 0 +#define cpumask_of_pcibus (bus) 0 + +const struct cpumask *cpumask_of_node (int node); +/* Mappings between node number and cpus on that node. */ +extern cpumask_var_t node_to_cpumask_map[MAX_NUMNODES ]; + +void __init arm64_numa_init (void ); +int __init numa_add_memblk (u32 nodeid,u64 start,u64 end); +void numa_store_cpu_info (int cpu); +void numa_set_node (int cpu,int node); +void numa_clear_node (int cpu); +void numa_add_cpu (int cpu); +void numa_remove_cpu (int cpu); +#else /* CONFIG_NUMA */ +static inline void arm64_numa_init (void ); +static inline void numa_store_cpu_info (int cpu) { } +static inline void arm64_numa_init () { } +#endif /* CONFIG_NUMA */ +#endif /* _ASM_ARM64_NUMA_H */
arch/arm64/kernel/setup.c +8 -0
@@ -425,6 +425,9 @@ static int __init topology_init(void) {int i; +for_each_online_node (i) +register_one_node (i); +for_each_possible_cpu (i) {struct cpu *cpu = &per_cpu (cpu_data.cpu, i); cpu->hotpluggable =1 ;
@@ -461,7 +464,12 @@ static int c_show(struct seq_file *m, void *v)* "processor". Give glibc what it expects. */ #ifdef CONFIG_SMP +if (IS_ENABLED (CONFIG_NUMA )) { +seq_printf (m,"processor\t: %d" , i); +seq_printf (m," [nid: %d]\n" ,cpu_to_node (i)); + }else {seq_printf (m,"processor\t: %d\n" , i); + }#endif }
arch/arm64/kernel/smp.c +2 -0
@@ -50,6 +50,7 @@#include <asm/sections.h> #include <asm/tlbflush.h> #include <asm/ptrace.h> +#include <asm/numa.h> #define CREATE_TRACE_POINTS #include <trace/events/ipi.h>
@@ -123,6 +124,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *idle)static void smp_store_cpu_info (unsigned int cpuid) {store_cpu_topology (cpuid); +numa_store_cpu_info (cpuid); }/*
arch/arm64/mm/Makefile +1 -0
@@ -3,3 +3,4 @@ obj-y := dma-mapping.o extable.o fault.o init.o \ ioremap.o mmap.o pgd.o mmu.o \ context.o proc.o pageattr.o obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o +obj-$(CONFIG_NUMA) += numa.o
arch/arm64/mm/init.c +28 -6
@@ -39,6 +39,7 @@#include <asm/setup.h> #include <asm/sizes.h> #include <asm/tlb.h> +#include <asm/numa.h> #include "mm.h"
@@ -73,6 +74,20 @@ static phys_addr_t max_zone_dma_phys(void)return min (offset + (1ULL <<32 ),memblock_end_of_DRAM ()); } +#ifdef CONFIG_NUMA +static void __init zone_sizes_init (unsigned long min,unsigned long max) +{ +unsigned long max_zone_pfns[MAX_NR_ZONES ]; + +memset (max_zone_pfns,0 ,sizeof (max_zone_pfns)); +if (IS_ENABLED (CONFIG_ZONE_DMA )) + max_zone_pfns[ZONE_DMA ] =PFN_DOWN (max_zone_dma_phys ()); + max_zone_pfns[ZONE_NORMAL ] = max; + +free_area_init_nodes (max_zone_pfns); +} + +#else static void __init zone_sizes_init (unsigned long min,unsigned long max) {struct memblock_region *reg;
@@ -111,6 +126,7 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max) free_area_init_node(0, zone_size, min, zhole_size); } +#endif /* CONFIG_NUMA */ #ifdef CONFIG_HAVE_ARCH_PFN_VALID int pfn_valid (unsigned long pfn)
@@ -128,10 +144,15 @@ static void arm64_memory_present(void)static void arm64_memory_present (void ) {struct memblock_region *reg; +int nid =0 ; -for_each_memblock (memory, reg) -memory_present (0 ,memblock_region_memory_base_pfn (reg), -memblock_region_memory_end_pfn (reg)); +for_each_memblock (memory, reg) { +#ifdef CONFIG_NUMA + nid = reg->nid; +#endif +memory_present (nid,memblock_region_memory_base_pfn (reg), +memblock_region_memory_end_pfn (reg)); + } }#endif
@@ -167,6 +188,10 @@ void __init bootmem_init(void) min =PFN_UP (memblock_start_of_DRAM ()); max =PFN_DOWN (memblock_end_of_DRAM ()); + high_memory =__va ((max <<PAGE_SHIFT ) -1 ) +1 ; + max_pfn = max_low_pfn = max; + +arm64_numa_init ();/* * Sparsemem tries to allocate bootmem in memory_present(), so must be * done after the fixed reservations.
@@ -175,9 +200,6 @@ void __init bootmem_init(void)sparse_init ();zone_sizes_init (min, max); - - high_memory =__va ((max <<PAGE_SHIFT ) -1 ) +1 ; - max_pfn = max_low_pfn = max; }#ifndef CONFIG_SPARSEMEM_VMEMMAP
arch/arm64/mm/numa.c new file +631 -0
631 lines not on this page · raw message
Signature · 1 line
1.8.1.4
RFC PATCH v2 4/4 arm64:numa: adding numa support for arm64 platforms.
Quoted 4 lines · Ganapatrao Kulkarni
Adding numa support for arm64 based platforms. creating numa mapping by parsing the dt node numa-map.
Signed-off-by Ganapatrao Kulkarni <[email protected]>
Ganapat,
Can we get a simple version of this patchset with just the associativity parameter for the cpu and memory nodes upstream? The initial patchset can be with the assumption of a simple full mesh topology for the distance. The hierarchical complex topologies and the DT nodes and properties for that can be added in a later patch, once the standard for that is agreed upon.
We are planning to support ACPI based NUMA for Broadcom Vulcan processors(http://www.broadcom.com/press/release.php?id=s797235).
I am working on a patch to add support for the SRAT and SLIT ACPI tables based on your patch and I will post that patchset soon, so it will be helpful if the core changes are upstream.
Thanks,
Ashok
Re: [RFC PATCH v2 4/4] arm64:numa: adding numa support for arm64 platforms.
In reply to Ganapatrao KulkarniQuoted 4 lines · Ganapatrao Kulkarni
Adding numa support for arm64 based platforms. creating numa mapping by parsing the dt node numa-map.
Signed-off-by Ganapatrao Kulkarni <[email protected]>
Ganapat,
Can we get a simple version of this patchset with just the associativity parameter for the cpu and memory nodes upstream? The initial patchset can be with the assumption of a simple full mesh topology for the distance. The hierarchical complex topologies and the DT nodes and properties for that can be added in a later patch, once the standard for that is agreed upon.
We are planning to support ACPI based NUMA for Broadcom Vulcan processors(http://www.broadcom.com/press/release.php?id=s797235).
I am working on a patch to add support for the SRAT and SLIT ACPI tables based on your patch and I will post that patchset soon, so it will be helpful if the core changes are upstream.
Thanks,
Ashok
Re: [RFC PATCH v2 4/4] arm64:numa: adding numa support for arm64 platforms.
In reply to Ganapatrao KulkarniQuoted 4 lines · Ganapatrao Kulkarni
Adding numa support for arm64 based platforms. creating numa mapping by parsing the dt node numa-map.
Signed-off-by Ganapatrao Kulkarni <[email protected]>
Ganapat,
Can we get a simple version of this patchset with just the associativity parameter for the cpu and memory nodes upstream? The initial patchset can be with the assumption of a simple full mesh topology for the distance. The hierarchical complex topologies and the DT nodes and properties for that can be added in a later patch, once the standard for that is agreed upon.
We are planning to support ACPI based NUMA for Broadcom Vulcan processors(http://www.broadcom.com/press/release.php?id=s797235).
I am working on a patch to add support for the SRAT and SLIT ACPI tables based on your patch and I will post that patchset soon, so it will be helpful if the core changes are upstream.
Thanks,
Ashok
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [RFC PATCH v2 4/4] arm64:numa: adding numa support for arm64 platforms.
In reply to Ganapatrao KulkarniQuoted 4 lines · Ganapatrao Kulkarni
Adding numa support for arm64 based platforms. creating numa mapping by parsing the dt node numa-map.
Signed-off-by Ganapatrao Kulkarni <[email protected]>
Ganapat,
Can we get a simple version of this patchset with just the associativity parameter for the cpu and memory nodes upstream? The initial patchset can be with the assumption of a simple full mesh topology for the distance. The hierarchical complex topologies and the DT nodes and properties for that can be added in a later patch, once the standard for that is agreed upon.
We are planning to support ACPI based NUMA for Broadcom Vulcan processors(http://www.broadcom.com/press/release.php?id=s797235).
I am working on a patch to add support for the SRAT and SLIT ACPI tables based on your patch and I will post that patchset soon, so it will be helpful if the core changes are upstream.
Thanks,
Ashok
A message that is not in the archive (sent off-list or not yet received): [email protected]
RFC PATCH v2 4/4 arm64:numa: adding numa support for arm64 platforms.
Quoted 7 lines · Ashok Kumar
Quoted 4 lines · Ganapatrao Kulkarni
Adding numa support for arm64 based platforms. creating numa mapping by parsing the dt node numa-map.
Signed-off-by Ganapatrao Kulkarni <[email protected]>Ganapat,
Quoted 8 lines
Can we get a simple version of this patchset with just the associativity parameter for the cpu and memory nodes upstream? The initial patchset can be with the assumption of a simple full mesh topology for the distance. The hierarchical complex topologies and the DT nodes and properties for that can be added in a later patch, once the standard for that is agreed upon.
We are planning to support ACPI based NUMA for Broadcom Vulcan processors(http://www.broadcom.com/press/release.php?id=s797235).
I am working on a patch to add support for the SRAT and SLIT ACPI tables based on your patch and I will post that patchset soon, so it will be helpful if the core changes are upstream.
to implement, ibm/ppc like implementation, we need efi-stub patch to not remove the memory node from the dt.
current efi-stub parses dt file and removes memory nodes. can i get the efi-stub patch to start with please?
Quoted 3 lines
Thanks,
Ashok
thanks
ganapat
RFC PATCH v2 4/4 arm64:numa: adding numa support for arm64 platforms.
Quoted 16 lines · Ganapatrao Kulkarni
Quoted 7 lines · Ashok Kumar
Quoted 4 lines · Ganapatrao Kulkarni
Adding numa support for arm64 based platforms. creating numa mapping by parsing the dt node numa-map.
Signed-off-by Ganapatrao Kulkarni <[email protected]>Ganapat,
Quoted 8 lines
Can we get a simple version of this patchset with just the associativity parameter for the cpu and memory nodes upstream? The initial patchset can be with the assumption of a simple full mesh topology for the distance. The hierarchical complex topologies and the DT nodes and properties for that can be added in a later patch, once the standard for that is agreed upon.
We are planning to support ACPI based NUMA for Broadcom Vulcan processors(http://www.broadcom.com/press/release.php?id=s797235). I am working on a patch to add support for the SRAT and SLIT ACPI tables based on your patch and I will post that patchset soon, so it will be helpful if the core changes are upstream.
Quoted 4 lines
to implement, ibm/ppc like implementation, we need efi-stub patch to not remove the memory node from the dt.
current efi-stub parses dt file and removes memory nodes. can i get the efi-stub patch to start with please?
Ganapat,
I tried the below patch in qemu and it works. Would this be of help to you?
Roy/Ard,
Is the below patch fine?
Quoted 1 line
From
27b4aecf09707e3d5bd4ff7bf765cd609772476fMon Sep 17 00:00:00 2001
From: Ashok Kumar <[email protected]>
Date: Tue, 9 Dec 2014 17:23:11 +0530
Subject: [PATCH] efi/arm64: Remove deleting memory nodes in efi-stub
Dont delete memory nodes from DT as it will be used by NUMA configuration.
--- arch/arm64/kernel/setup.c | 12 +++++++++++- drivers/firmware/efi/libstub/fdt.c | 24 +----------------------- 2 files changed, 12 insertions(+), 24 deletions(-)
arch/arm64/kernel/setup.c +11 -1
@@ -302,7 +302,7 @@ static void __init setup_processor(void)static void __init setup_machine_fdt (phys_addr_t dt_phys) { -if (!dt_phys || !early_init_dt_scan (phys_to_virt (dt_phys))) { +if (!dt_phys || !early_init_dt_verify (phys_to_virt (dt_phys))) {early_print ("\n" "Error: invalid device tree blob at physical address 0x%p (virtual address 0x%p)\n" "The dtb must be 8-byte aligned and passed in the first 512MB of memory\n"
@@ -313,6 +313,16 @@ static void __init setup_machine_fdt(phys_addr_t dt_phys)cpu_relax (); } +/* Retrieve various information from the /chosen node */ +of_scan_flat_dt (early_init_dt_scan_chosen, boot_command_line); + +/* Initialize {size,address}-cells info */ +of_scan_flat_dt (early_init_dt_scan_root,NULL ); + +/* Setup memory, calling early_init_dt_add_memory_arch */ +if (!IS_ENABLED (CONFIG_EFI )) +of_scan_flat_dt (early_init_dt_scan_memory,NULL ); + machine_name =of_flat_dt_get_machine_name (); }
drivers/firmware/efi/libstub/fdt.c +1 -23
@@ -22,7 +22,7 @@ efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt, unsigned long map_size, unsigned long desc_size, u32 desc_ver) { - int node, prev, num_rsv; + int node, num_rsv;int status;u32 fdt_val32;u64 fdt_val64;
@@ -52,28 +52,6 @@ efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt, goto fdt_set_fail;/* -* Delete any memory nodes present. We must delete nodes which -* early_init_dt_scan_memory may try to use. -*/ - prev =0 ; -for (;;) { -const char *type; -int len; - - node =fdt_next_node (fdt, prev,NULL ); -if (node <0 ) -break ; - - type =fdt_getprop (fdt, node,"device_type" , &len); -if (type &&strncmp (type,"memory" , len) ==0 ) { -fdt_del_node (fdt, node); -continue ; - } - - prev = node; - } - -/* * Delete all memory reserve map entries. When booting via UEFI, * kernel will use the UEFI memory map to find reserved regions. */
Signature · 5 lines
1.9.1 Thanks, Ashok
Re: [RFC PATCH v2 4/4] arm64:numa: adding numa support for arm64 platforms.
In reply to Ganapatrao KulkarniQuoted 16 lines · Ganapatrao Kulkarni
Quoted 7 lines · Ashok Kumar
Quoted 4 lines · Ganapatrao Kulkarni
Adding numa support for arm64 based platforms. creating numa mapping by parsing the dt node numa-map.
Signed-off-by Ganapatrao Kulkarni <[email protected]>Ganapat,
Quoted 8 lines
Can we get a simple version of this patchset with just the associativity parameter for the cpu and memory nodes upstream? The initial patchset can be with the assumption of a simple full mesh topology for the distance. The hierarchical complex topologies and the DT nodes and properties for that can be added in a later patch, once the standard for that is agreed upon.
We are planning to support ACPI based NUMA for Broadcom Vulcan processors(http://www.broadcom.com/press/release.php?id=s797235). I am working on a patch to add support for the SRAT and SLIT ACPI tables based on your patch and I will post that patchset soon, so it will be helpful if the core changes are upstream.
Quoted 4 lines
to implement, ibm/ppc like implementation, we need efi-stub patch to not remove the memory node from the dt.
current efi-stub parses dt file and removes memory nodes. can i get the efi-stub patch to start with please?
Ganapat,
I tried the below patch in qemu and it works. Would this be of help to you?
Roy/Ard,
Is the below patch fine?
Quoted 1 line
From
27b4aecf09707e3d5bd4ff7bf765cd609772476fMon Sep 17 00:00:00 2001
From: Ashok Kumar <[email protected]>
Date: Tue, 9 Dec 2014 17:23:11 +0530
Subject: [PATCH] efi/arm64: Remove deleting memory nodes in efi-stub
Dont delete memory nodes from DT as it will be used by NUMA configuration.
--- arch/arm64/kernel/setup.c | 12 +++++++++++- drivers/firmware/efi/libstub/fdt.c | 24 +----------------------- 2 files changed, 12 insertions(+), 24 deletions(-)
arch/arm64/kernel/setup.c +11 -1
@@ -302,7 +302,7 @@ static void __init setup_processor(void)static void __init setup_machine_fdt (phys_addr_t dt_phys) { -if (!dt_phys || !early_init_dt_scan (phys_to_virt (dt_phys))) { +if (!dt_phys || !early_init_dt_verify (phys_to_virt (dt_phys))) {early_print ("\n" "Error: invalid device tree blob at physical address 0x%p (virtual address 0x%p)\n" "The dtb must be 8-byte aligned and passed in the first 512MB of memory\n"
@@ -313,6 +313,16 @@ static void __init setup_machine_fdt(phys_addr_t dt_phys)cpu_relax (); } +/* Retrieve various information from the /chosen node */ +of_scan_flat_dt (early_init_dt_scan_chosen, boot_command_line); + +/* Initialize {size,address}-cells info */ +of_scan_flat_dt (early_init_dt_scan_root,NULL ); + +/* Setup memory, calling early_init_dt_add_memory_arch */ +if (!IS_ENABLED (CONFIG_EFI )) +of_scan_flat_dt (early_init_dt_scan_memory,NULL ); + machine_name =of_flat_dt_get_machine_name (); }
drivers/firmware/efi/libstub/fdt.c +1 -23
@@ -22,7 +22,7 @@ efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt, unsigned long map_size, unsigned long desc_size, u32 desc_ver) { - int node, prev, num_rsv; + int node, num_rsv;int status;u32 fdt_val32;u64 fdt_val64;
@@ -52,28 +52,6 @@ efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt, goto fdt_set_fail;/* -* Delete any memory nodes present. We must delete nodes which -* early_init_dt_scan_memory may try to use. -*/ - prev =0 ; -for (;;) { -const char *type; -int len; - - node =fdt_next_node (fdt, prev,NULL ); -if (node <0 ) -break ; - - type =fdt_getprop (fdt, node,"device_type" , &len); -if (type &&strncmp (type,"memory" , len) ==0 ) { -fdt_del_node (fdt, node); -continue ; - } - - prev = node; - } - -/* * Delete all memory reserve map entries. When booting via UEFI, * kernel will use the UEFI memory map to find reserved regions. */
Signature · 5 lines
1.9.1 Thanks, Ashok
Re: [RFC PATCH v2 4/4] arm64:numa: adding numa support for arm64 platforms.
In reply to Ganapatrao KulkarniQuoted 16 lines · Ganapatrao Kulkarni
Quoted 7 lines · Ashok Kumar
Quoted 4 lines · Ganapatrao Kulkarni
Adding numa support for arm64 based platforms. creating numa mapping by parsing the dt node numa-map.
Signed-off-by Ganapatrao Kulkarni <[email protected]>Ganapat,
Quoted 8 lines
Can we get a simple version of this patchset with just the associativity parameter for the cpu and memory nodes upstream? The initial patchset can be with the assumption of a simple full mesh topology for the distance. The hierarchical complex topologies and the DT nodes and properties for that can be added in a later patch, once the standard for that is agreed upon.
We are planning to support ACPI based NUMA for Broadcom Vulcan processors(http://www.broadcom.com/press/release.php?id=s797235). I am working on a patch to add support for the SRAT and SLIT ACPI tables based on your patch and I will post that patchset soon, so it will be helpful if the core changes are upstream.
Quoted 4 lines
to implement, ibm/ppc like implementation, we need efi-stub patch to not remove the memory node from the dt.
current efi-stub parses dt file and removes memory nodes. can i get the efi-stub patch to start with please?
Ganapat,
I tried the below patch in qemu and it works. Would this be of help to you?
Roy/Ard,
Is the below patch fine?
Quoted 1 line
From
27b4aecf09707e3d5bd4ff7bf765cd609772476fMon Sep 17 00:00:00 2001
From: Ashok Kumar <[email protected]>
Date: Tue, 9 Dec 2014 17:23:11 +0530
Subject: [PATCH] efi/arm64: Remove deleting memory nodes in efi-stub
Dont delete memory nodes from DT as it will be used by NUMA configuration.
--- arch/arm64/kernel/setup.c | 12 +++++++++++- drivers/firmware/efi/libstub/fdt.c | 24 +----------------------- 2 files changed, 12 insertions(+), 24 deletions(-)
arch/arm64/kernel/setup.c +11 -1
@@ -302,7 +302,7 @@ static void __init setup_processor(void)static void __init setup_machine_fdt (phys_addr_t dt_phys) { -if (!dt_phys || !early_init_dt_scan (phys_to_virt (dt_phys))) { +if (!dt_phys || !early_init_dt_verify (phys_to_virt (dt_phys))) {early_print ("\n" "Error: invalid device tree blob at physical address 0x%p (virtual address 0x%p)\n" "The dtb must be 8-byte aligned and passed in the first 512MB of memory\n"
@@ -313,6 +313,16 @@ static void __init setup_machine_fdt(phys_addr_t dt_phys)cpu_relax (); } +/* Retrieve various information from the /chosen node */ +of_scan_flat_dt (early_init_dt_scan_chosen, boot_command_line); + +/* Initialize {size,address}-cells info */ +of_scan_flat_dt (early_init_dt_scan_root,NULL ); + +/* Setup memory, calling early_init_dt_add_memory_arch */ +if (!IS_ENABLED (CONFIG_EFI )) +of_scan_flat_dt (early_init_dt_scan_memory,NULL ); + machine_name =of_flat_dt_get_machine_name (); }
drivers/firmware/efi/libstub/fdt.c +1 -23
@@ -22,7 +22,7 @@ efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt, unsigned long map_size, unsigned long desc_size, u32 desc_ver) { - int node, prev, num_rsv; + int node, num_rsv;int status;u32 fdt_val32;u64 fdt_val64;
@@ -52,28 +52,6 @@ efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt, goto fdt_set_fail;/* -* Delete any memory nodes present. We must delete nodes which -* early_init_dt_scan_memory may try to use. -*/ - prev =0 ; -for (;;) { -const char *type; -int len; - - node =fdt_next_node (fdt, prev,NULL ); -if (node <0 ) -break ; - - type =fdt_getprop (fdt, node,"device_type" , &len); -if (type &&strncmp (type,"memory" , len) ==0 ) { -fdt_del_node (fdt, node); -continue ; - } - - prev = node; - } - -/* * Delete all memory reserve map entries. When booting via UEFI, * kernel will use the UEFI memory map to find reserved regions. */
Signature · 5 lines
1.9.1 Thanks, Ashok
Re: [RFC PATCH v2 4/4] arm64:numa: adding numa support for arm64 platforms.
In reply to Ganapatrao KulkarniQuoted 16 lines · Ganapatrao Kulkarni
Quoted 7 lines · Ashok Kumar
Quoted 4 lines · Ganapatrao Kulkarni
Adding numa support for arm64 based platforms. creating numa mapping by parsing the dt node numa-map.
Signed-off-by Ganapatrao Kulkarni <[email protected]>Ganapat,
Quoted 8 lines
Can we get a simple version of this patchset with just the associativity parameter for the cpu and memory nodes upstream? The initial patchset can be with the assumption of a simple full mesh topology for the distance. The hierarchical complex topologies and the DT nodes and properties for that can be added in a later patch, once the standard for that is agreed upon.
We are planning to support ACPI based NUMA for Broadcom Vulcan processors(http://www.broadcom.com/press/release.php?id=s797235). I am working on a patch to add support for the SRAT and SLIT ACPI tables based on your patch and I will post that patchset soon, so it will be helpful if the core changes are upstream.
Quoted 4 lines
to implement, ibm/ppc like implementation, we need efi-stub patch to not remove the memory node from the dt.
current efi-stub parses dt file and removes memory nodes. can i get the efi-stub patch to start with please?
Ganapat,
I tried the below patch in qemu and it works. Would this be of help to you?
Roy/Ard,
Is the below patch fine?
Quoted 1 line
From
27b4aecf09707e3d5bd4ff7bf765cd609772476fMon Sep 17 00:00:00 2001
From: Ashok Kumar <[email protected]>
Date: Tue, 9 Dec 2014 17:23:11 +0530
Subject: [PATCH] efi/arm64: Remove deleting memory nodes in efi-stub
Dont delete memory nodes from DT as it will be used by NUMA configuration.
--- arch/arm64/kernel/setup.c | 12 +++++++++++- drivers/firmware/efi/libstub/fdt.c | 24 +----------------------- 2 files changed, 12 insertions(+), 24 deletions(-)
arch/arm64/kernel/setup.c +11 -1
@@ -302,7 +302,7 @@ static void __init setup_processor(void)static void __init setup_machine_fdt (phys_addr_t dt_phys) { -if (!dt_phys || !early_init_dt_scan (phys_to_virt (dt_phys))) { +if (!dt_phys || !early_init_dt_verify (phys_to_virt (dt_phys))) {early_print ("\n" "Error: invalid device tree blob at physical address 0x%p (virtual address 0x%p)\n" "The dtb must be 8-byte aligned and passed in the first 512MB of memory\n"
@@ -313,6 +313,16 @@ static void __init setup_machine_fdt(phys_addr_t dt_phys)cpu_relax (); } +/* Retrieve various information from the /chosen node */ +of_scan_flat_dt (early_init_dt_scan_chosen, boot_command_line); + +/* Initialize {size,address}-cells info */ +of_scan_flat_dt (early_init_dt_scan_root,NULL ); + +/* Setup memory, calling early_init_dt_add_memory_arch */ +if (!IS_ENABLED (CONFIG_EFI )) +of_scan_flat_dt (early_init_dt_scan_memory,NULL ); + machine_name =of_flat_dt_get_machine_name (); }
drivers/firmware/efi/libstub/fdt.c +1 -23
@@ -22,7 +22,7 @@ efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt, unsigned long map_size, unsigned long desc_size, u32 desc_ver) { - int node, prev, num_rsv; + int node, num_rsv;int status;u32 fdt_val32;u64 fdt_val64;
@@ -52,28 +52,6 @@ efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt, goto fdt_set_fail;/* -* Delete any memory nodes present. We must delete nodes which -* early_init_dt_scan_memory may try to use. -*/ - prev =0 ; -for (;;) { -const char *type; -int len; - - node =fdt_next_node (fdt, prev,NULL ); -if (node <0 ) -break ; - - type =fdt_getprop (fdt, node,"device_type" , &len); -if (type &&strncmp (type,"memory" , len) ==0 ) { -fdt_del_node (fdt, node); -continue ; - } - - prev = node; - } - -/* * Delete all memory reserve map entries. When booting via UEFI, * kernel will use the UEFI memory map to find reserved regions. */
Signature · 10 lines
1.9.1 Thanks, Ashok _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
A message that is not in the archive (sent off-list or not yet received): [email protected]
RFC PATCH v2 4/4 arm64:numa: adding numa support for arm64 platforms.
Hi Roy/Leif
Quoted 115 lines · Ashok Kumar
Quoted 16 lines · Ganapatrao Kulkarni
Quoted 7 lines · Ashok Kumar
Quoted 4 lines · Ganapatrao Kulkarni
Adding numa support for arm64 based platforms. creating numa mapping by parsing the dt node numa-map.
Signed-off-by Ganapatrao Kulkarni <[email protected]>Ganapat,
Quoted 8 lines
Can we get a simple version of this patchset with just the associativity parameter for the cpu and memory nodes upstream? The initial patchset can be with the assumption of a simple full mesh topology for the distance. The hierarchical complex topologies and the DT nodes and properties for that can be added in a later patch, once the standard for that is agreed upon.
We are planning to support ACPI based NUMA for Broadcom Vulcan processors(http://www.broadcom.com/press/release.php?id=s797235). I am working on a patch to add support for the SRAT and SLIT ACPI tables based on your patch and I will post that patchset soon, so it will be helpful if the core changes are upstream.Quoted 4 lines
to implement, ibm/ppc like implementation, we need efi-stub patch to not remove the memory node from the dt.
current efi-stub parses dt file and removes memory nodes. can i get the efi-stub patch to start with please?Ganapat,
I tried the below patch in qemu and it works. Would this be of help to you?Roy/Ard,
Is the below patch fine?From
27b4aecf09707e3d5bd4ff7bf765cd609772476fMon Sep 17 00:00:00 2001
From: Ashok Kumar <[email protected]>
Date: Tue, 9 Dec 2014 17:23:11 +0530
Subject: [PATCH] efi/arm64: Remove deleting memory nodes in efi-stubDont delete memory nodes from DT as it will be
used by NUMA configuration.Signed-off-by Ashok Kumar <[email protected]>--- arch/arm64/kernel/setup.c | 12 +++++++++++- drivers/firmware/efi/libstub/fdt.c | 24 +----------------------- 2 files changed, 12 insertions(+), 24 deletions(-)arch/arm64/kernel/setup.c +11
-1@@ -302,7 +302,7 @@ static void __init setup_processor(void)static void __init setup_machine_fdt (phys_addr_t dt_phys) { -if (!dt_phys || !early_init_dt_scan (phys_to_virt (dt_phys))) { +if (!dt_phys || !early_init_dt_verify (phys_to_virt (dt_phys))) {early_print ("\n" "Error: invalid device tree blob at physical address 0x%p (virtual address 0x%p)\n" "The dtb must be 8-byte aligned and passed in the first 512MB of memory\n"@@ -313,6 +313,16 @@ static void __init setup_machine_fdt(phys_addr_t dt_phys)cpu_relax (); } +/* Retrieve various information from the /chosen node */ +of_scan_flat_dt (early_init_dt_scan_chosen, boot_command_line); + +/* Initialize {size,address}-cells info */ +of_scan_flat_dt (early_init_dt_scan_root,NULL ); + +/* Setup memory, calling early_init_dt_add_memory_arch */ +if (!IS_ENABLED (CONFIG_EFI )) +of_scan_flat_dt (early_init_dt_scan_memory,NULL ); + machine_name =of_flat_dt_get_machine_name (); }drivers/firmware/efi/libstub/fdt.c +1
-24@@ -22,7 +22,7 @@ efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt, unsigned long map_size, unsigned long desc_size, u32 desc_ver) { - int node, prev, num_rsv; + int node, num_rsv;int status;u32 fdt_val32;u64 fdt_val64;@@ -52,28 +52,6 @@ efi_status_t update_fdt(efi_system_table_t *sys_table, void *orig_fdt, goto fdt_set_fail;/* -* Delete any memory nodes present. We must delete nodes which -* early_init_dt_scan_memory may try to use. -*/ - prev =0 ; -for (;;) { -const char *type; -int len; - - node =fdt_next_node (fdt, prev,NULL ); -if (node <0 ) -break ; - - type =fdt_getprop (fdt, node,"device_type" , &len); -if (type &&strncmp (type,"memory" , len) ==0 ) { -fdt_del_node (fdt, node); -continue ; - } - - prev = node; - } - -/* * Delete all memory reserve map entries. When booting via UEFI, * kernel will use the UEFI memory map to find reserved regions. */ --
Quoted 3 lines
1.9.1
what will happen, If we keep memory node in the DT and boot with UEFI, will both efi-stub and dt try to add memblocks?
is kernel ignores second request to add memblock to the same address?
Quoted 2 lines
Thanks,
Ashok
thanks
Ganapat