← Documents Documentation/arch/powerpc/associativity.rst GitHub 원문 ↗

Linux 6.18.37 · Architecture

NUMA Resource Associativity

PAPR Form 0/1/2 resource grouping과 NUMA distance 계산 방식을 설명합니다.

Source pathDocumentation/arch/powerpc/associativity.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약과 해설

associativity.rst:1-105

Form 0은 local/remote 두 거리만, Form 1은 계층형 `domainID` 비교를, Form 2는 lookup index와 명시적 distance matrix를 사용합니다. Sparse domain ID를 compact matrix로 바꾸는 것이 Form 2의 핵심입니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 ============================
2 NUMA resource associativity
3 ============================
4
5 Associativity represents the groupings of the various platform resources into
6 domains of substantially similar mean performance relative to resources outside
7 of that domain. Resources subsets of a given domain that exhibit better
8 performance relative to each other than relative to other resources subsets
9 are represented as being members of a sub-grouping domain. This performance
10 characteristic is presented in terms of NUMA node distance within the Linux kernel.
11 From the platform view, these groups are also referred to as domains.
12
13 PAPR interface currently supports different ways of communicating these resource
14 grouping details to the OS. These are referred to as Form 0, Form 1 and Form2
15 associativity grouping. Form 0 is the oldest format and is now considered deprecated.
16
17 Hypervisor indicates the type/form of associativity used via "ibm,architecture-vec-5 property".
18 Bit 0 of byte 5 in the "ibm,architecture-vec-5" property indicates usage of Form 0 or Form 1.
19 A value of 1 indicates the usage of Form 1 associativity. For Form 2 associativity
20 bit 2 of byte 5 in the "ibm,architecture-vec-5" property is used.
21
22 Form 0
23 ------
24 Form 0 associativity supports only two NUMA distances (LOCAL and REMOTE).
25
26 Form 1
27 ------
28 With Form 1 a combination of ibm,associativity-reference-points, and ibm,associativity
29 device tree properties are used to determine the NUMA distance between resource groups/domains.
30
31 The “ibm,associativity” property contains a list of one or more numbers (domainID)
32 representing the resource’s platform grouping domains.
33
34 The “ibm,associativity-reference-points” property contains a list of one or more numbers
35 (domainID index) that represents the 1 based ordinal in the associativity lists.
36 The list of domainID indexes represents an increasing hierarchy of resource grouping.
37
38 ex:
39 { primary domainID index, secondary domainID index, tertiary domainID index.. }
40
41 Linux kernel uses the domainID at the primary domainID index as the NUMA node id.
42 Linux kernel computes NUMA distance between two domains by recursively comparing
43 if they belong to the same higher-level domains. For mismatch at every higher
44 level of the resource group, the kernel doubles the NUMA distance between the
45 comparing domains.
46
47 Form 2
48 -------
49 Form 2 associativity format adds separate device tree properties representing NUMA node distance
50 thereby making the node distance computation flexible. Form 2 also allows flexible primary
51 domain numbering. With numa distance computation now detached from the index value in
52 "ibm,associativity-reference-points" property, Form 2 allows a large number of primary domain
53 ids at the same domainID index representing resource groups of different performance/latency
54 characteristics.
55
56 Hypervisor indicates the usage of FORM2 associativity using bit 2 of byte 5 in the
57 "ibm,architecture-vec-5" property.
58
59 "ibm,numa-lookup-index-table" property contains a list of one or more numbers representing
60 the domainIDs present in the system. The offset of the domainID in this property is
61 used as an index while computing numa distance information via "ibm,numa-distance-table".
62
63 prop-encoded-array: The number N of the domainIDs encoded as with encode-int, followed by
64 N domainID encoded as with encode-int
65
66 For ex:
67 "ibm,numa-lookup-index-table" = {4, 0, 8, 250, 252}. The offset of domainID 8 (2) is used when
68 computing the distance of domain 8 from other domains present in the system. For the rest of
69 this document, this offset will be referred to as domain distance offset.
70
71 "ibm,numa-distance-table" property contains a list of one or more numbers representing the NUMA
72 distance between resource groups/domains present in the system.
73
74 prop-encoded-array: The number N of the distance values encoded as with encode-int, followed by
75 N distance values encoded as with encode-bytes. The max distance value we could encode is 255.
76 The number N must be equal to the square of m where m is the number of domainIDs in the
77 numa-lookup-index-table.
78
79 For ex:
80 ibm,numa-lookup-index-table = <3 0 8 40>;
81 ibm,numa-distace-table = <9>, /bits/ 8 < 10 20 80 20 10 160 80 160 10>;
82
83 ::
84
85 | 0 8 40
86 --|------------
87 |
88 0 | 10 20 80
89 |
90 8 | 20 10 160
91 |
92 40| 80 160 10
93
94 A possible "ibm,associativity" property for resources in node 0, 8 and 40
95
96 { 3, 6, 7, 0 }
97 { 3, 6, 9, 8 }
98 { 3, 6, 7, 40}
99
100 With "ibm,associativity-reference-points" { 0x3 }
101
102 "ibm,lookup-index-table" helps in having a compact representation of distance matrix.
103 Since domainID can be sparse, the matrix of distances can also be effectively sparse.
104 With "ibm,lookup-index-table" we can achieve a compact representation of
105 distance information.
106

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

NUMA resource associativity와 PAPR 형식

1-21

Resource associativity는 domain 밖의 resource와 비교했을 때 평균 성능이 상당히 비슷한 platform resource를 하나의 domain으로 묶는 개념입니다. 같은 domain 안에서도 서로의 성능이 다른 subset보다 더 좋은 resource subset은 하위 grouping domain의 구성원으로 표현합니다. Linux kernel은 이 성능 특성을 NUMA node distance로 나타내며, platform 관점에서도 이러한 group을 domain이라고 부릅니다.

PAPR interface는 resource grouping 정보를 OS에 전달하는 Form 0, Form 1, Form 2 associativity를 지원합니다. Form 0은 가장 오래된 형식이며 현재 deprecated로 간주됩니다.

Hypervisor는 `ibm,architecture-vec-5` property로 associativity 형식을 알립니다. 이 property의 byte 5, bit 0은 Form 0과 Form 1을 구분하며 값 1은 Form 1을 뜻합니다. Form 2 사용 여부는 byte 5, bit 2로 표시합니다.

PAPR associativity 형식 선택
Byte 5 bit 0 = 0Form 0LOCAL / REMOTE
Byte 5 bit 0 = 1Form 1계층형 domainID
Byte 5 bit 2 = 1Form 2명시적 distance table

`ibm,architecture-vec-5`의 bit가 OS가 해석할 grouping 형식을 결정합니다.

Form 0

22-25

Form 0 associativity는 `LOCAL`과 `REMOTE`라는 두 가지 NUMA distance만 지원합니다.

Form 1

26-46

Form 1에서는 `ibm,associativity-reference-points`와 `ibm,associativity` device-tree property를 조합해 resource group 또는 domain 사이의 NUMA distance를 결정합니다.

`ibm,associativity` property는 resource가 속한 platform grouping domain을 나타내는 하나 이상의 숫자, 즉 `domainID` 목록을 담습니다.

`ibm,associativity-reference-points` property는 associativity list에서 1부터 시작하는 순번을 나타내는 하나 이상의 숫자, 즉 `domainID index` 목록을 담습니다. 이 index 목록은 resource grouping의 상위 방향으로 증가하는 hierarchy를 나타냅니다.

{ primary domainID index, secondary domainID index, tertiary domainID index.. }

Linux kernel은 primary `domainID index` 위치의 `domainID`를 NUMA node ID로 사용합니다. 두 domain이 같은 상위 domain에 속하는지 재귀적으로 비교해 NUMA distance를 계산하며, resource group의 상위 level에서 불일치할 때마다 비교 대상 domain 사이의 NUMA distance를 두 배로 늘립니다.

Form 2 property

47-78

Form 2 associativity는 NUMA node distance를 나타내는 별도 device-tree property를 추가해 node-distance 계산을 유연하게 만들고 primary domain 번호도 자유롭게 지정할 수 있게 합니다. Distance 계산이 `ibm,associativity-reference-points`의 index 값에서 분리되므로, 같은 `domainID index`에 서로 다른 성능 또는 latency 특성을 가진 많은 primary domain ID를 둘 수 있습니다.

Hypervisor는 `ibm,architecture-vec-5` property의 byte 5, bit 2로 Form 2 사용을 알립니다.

`ibm,numa-lookup-index-table` property는 system에 존재하는 `domainID` 목록을 담습니다. 이 property에서 각 `domainID`의 offset은 `ibm,numa-distance-table`로 NUMA distance를 계산할 때 index로 사용되며, 이 문서에서는 이를 domain distance offset이라고 부릅니다.

Propertyprop-encoded-array 형식과 제약
`ibm,numa-lookup-index-table``encode-int`로 표현한 domainID 수 `N` 뒤에 `N`개의 domainID를 각각 `encode-int`로 기록
`ibm,numa-distance-table``encode-int`로 표현한 distance 값 수 `N` 뒤에 `N`개 값을 `encode-bytes`로 기록. 최댓값은 255이며, `N`은 lookup table의 domainID 수 `m`의 제곱

예를 들어 `ibm,numa-lookup-index-table = {4, 0, 8, 250, 252}`라면 domainID 8의 offset 2를 사용해 domain 8과 system의 다른 domain 사이 거리를 찾습니다.

Form 2 distance matrix 예

79-105
ibm,numa-lookup-index-table = <3 0 8 40>;
ibm,numa-distace-table = <9>, /bits/ 8 < 10  20  80 20  10 160 80 160  10>;
NUMA domain distance matrix
Domain0840
0102080
82010160
408016010
Local distance대각선 값은 모두 10입니다.
Symmetry행과 열을 바꿔도 distance가 같습니다.

Lookup index 순서 0, 8, 40을 행과 열에 적용한 명시적 distance matrix입니다.

Node 0, 8, 40의 resource가 가질 수 있는 `ibm,associativity` property는 각각 `{ 3, 6, 7, 0 }`, `{ 3, 6, 9, 8 }`, `{ 3, 6, 7, 40 }`이며, `ibm,associativity-reference-points`는 `{ 0x3 }`입니다.

원문 마지막 단락의 `ibm,lookup-index-table`은 sparse할 수 있는 domainID를 조밀한 matrix offset으로 바꿔 distance matrix를 compact하게 표현하도록 돕습니다.

원문의 예제 property 이름 `ibm,numa-distace-table`과 마지막 단락의 `ibm,lookup-index-table` 표기는 source spelling을 그대로 보존했습니다. 앞에서 정의한 정식 이름은 각각 `ibm,numa-distance-table`과 `ibm,numa-lookup-index-table`입니다.