| 1 |
# SPDX-License-Identifier: GPL-2.0 OR BSD-2-clause |
| 2 |
# Copyright 2023 Arm, Ltd. |
| 3 |
# |
| 4 |
# Based on numa.txt binding from Linux kernel |
| 5 |
# Copyright 2016 Cavium Networks, Inc. |
| 6 |
%YAML 1.2 |
| 7 |
--- |
| 8 |
$id: http://devicetree.org/schemas/numa-distance-map-v1.yaml# |
| 9 |
$schema: http://devicetree.org/meta-schemas/core.yaml# |
| 10 |
|
| 11 |
title: NUMA distance-map node |
| 12 |
|
| 13 |
maintainers: |
| 14 |
- [email protected] |
| 15 |
|
| 16 |
description: | |
| 17 |
Systems employing a Non Uniform Memory Access (NUMA) architecture contain |
| 18 |
collections of hardware resources including processors, memory, and I/O buses, |
| 19 |
that comprise what is commonly known as a NUMA node. |
| 20 |
Processor accesses to memory within the local NUMA node is generally faster |
| 21 |
than processor accesses to memory outside of the local NUMA node. |
| 22 |
DT defines interfaces that allow the platform to convey NUMA node |
| 23 |
topology information to OS. |
| 24 |
|
| 25 |
The optional device tree node "distance-map" describes the relative distance |
| 26 |
(memory latency) between all numa nodes. There must be only one device node |
| 27 |
distance-map which must reside in the root node. If the distance-map node is |
| 28 |
not present, a default distance-matrix is used. |
| 29 |
|
| 30 |
properties: |
| 31 |
$nodename: |
| 32 |
const: distance-map |
| 33 |
|
| 34 |
compatible: |
| 35 |
const: numa-distance-map-v1 |
| 36 |
|
| 37 |
distance-matrix: |
| 38 |
$ref: /schemas/types.yaml#/definitions/uint32-matrix |
| 39 |
items: |
| 40 |
items: |
| 41 |
- description: 1st NUMA node ID |
| 42 |
- description: 2nd NUMA node ID |
| 43 |
- description: distance from 1st to 2nd NUMA node |
| 44 |
minimum: 10 |
| 45 |
description: | |
| 46 |
Defines a matrix to describe the relative distances between all numa |
| 47 |
nodes. It is represented as a list of node pairs and their relative |
| 48 |
distance. |
| 49 |
|
| 50 |
Note: |
| 51 |
1. Each entry represents distance from first node to second node. |
| 52 |
The distances are equal in either direction. |
| 53 |
2. The distance from a node to self (local distance) is represented |
| 54 |
with value 10 and all internode distance should be represented with |
| 55 |
a value greater than 10. |
| 56 |
3. distance-matrix should have entries in lexicographical ascending |
| 57 |
order of nodes. |
| 58 |
|
| 59 |
Example: |
| 60 |
4 nodes connected in mesh/ring topology as below, |
| 61 |
|
| 62 |
0_______20______1 |
| 63 |
| | |
| 64 |
| | |
| 65 |
20 20 |
| 66 |
| | |
| 67 |
| | |
| 68 |
|_______________| |
| 69 |
3 20 2 |
| 70 |
|
| 71 |
If relative distance for each hop is 20, |
| 72 |
then internode distance would be, |
| 73 |
0 -> 1 = 20 |
| 74 |
1 -> 2 = 20 |
| 75 |
2 -> 3 = 20 |
| 76 |
3 -> 0 = 20 |
| 77 |
0 -> 2 = 40 |
| 78 |
1 -> 3 = 40 |
| 79 |
|
| 80 |
additionalProperties: false |
| 81 |
|
| 82 |
examples: |
| 83 |
- | |
| 84 |
distance-map { |
| 85 |
compatible = "numa-distance-map-v1"; |
| 86 |
distance-matrix = <0 0 10>, |
| 87 |
<0 1 20>, |
| 88 |
<0 2 40>, |
| 89 |
<0 3 20>, |
| 90 |
<1 0 20>, |
| 91 |
<1 1 10>, |
| 92 |
<1 2 20>, |
| 93 |
<1 3 40>, |
| 94 |
<2 0 40>, |
| 95 |
<2 1 20>, |
| 96 |
<2 2 10>, |
| 97 |
<2 3 20>, |
| 98 |
<3 0 20>, |
| 99 |
<3 1 40>, |
| 100 |
<3 2 20>, |
| 101 |
<3 3 10>; |
| 102 |
}; |
| 103 |
... |