← Documents Documentation/admin-guide/device-mapper/dm-service-time.rst GitHub 원문 ↗

Linux 6.18.37 · Administration / Device Mapper

dm-service-time

In-flight I/O 크기와 상대 throughput으로 예상 service time을 계산하는 multipath selector의 설정과 알고리즘입니다.

Source pathDocumentation/admin-guide/device-mapper/dm-service-time.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

Service-time 모델

dm-service-time.rst:1-15

Queue 크기를 상대 처리량으로 정규화해 최소 예상 시간 path를 고릅니다.

Parameter와 status

dm-service-time.rst:16-44

`repeat_count`, 상대 throughput, health와 in-flight 크기를 설명합니다.

최적화와 예제

dm-service-time.rst:45-101

Division 회피 규칙, tie-break와 같은 1:4 비율의 두 표현을 풀이합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 ===============
2 dm-service-time
3 ===============
4
5 dm-service-time is a path selector module for device-mapper targets,
6 which selects a path with the shortest estimated service time for
7 the incoming I/O.
8
9 The service time for each path is estimated by dividing the total size
10 of in-flight I/Os on a path with the performance value of the path.
11 The performance value is a relative throughput value among all paths
12 in a path-group, and it can be specified as a table argument.
13
14 The path selector name is 'service-time'.
15
16 Table parameters for each path:
17
18 [<repeat_count> [<relative_throughput>]]
19 <repeat_count>:
20 The number of I/Os to dispatch using the selected
21 path before switching to the next path.
22 If not given, internal default is used. To check
23 the default value, see the activated table.
24 <relative_throughput>:
25 The relative throughput value of the path
26 among all paths in the path-group.
27 The valid range is 0-100.
28 If not given, minimum value '1' is used.
29 If '0' is given, the path isn't selected while
30 other paths having a positive value are available.
31
32 Status for each path:
33
34 <status> <fail-count> <in-flight-size> <relative_throughput>
35 <status>:
36 'A' if the path is active, 'F' if the path is failed.
37 <fail-count>:
38 The number of path failures.
39 <in-flight-size>:
40 The size of in-flight I/Os on the path.
41 <relative_throughput>:
42 The relative throughput value of the path
43 among all paths in the path-group.
44
45
46 Algorithm
47 =========
48
49 dm-service-time adds the I/O size to 'in-flight-size' when the I/O is
50 dispatched and subtracts when completed.
51 Basically, dm-service-time selects a path having minimum service time
52 which is calculated by::
53
54 ('in-flight-size' + 'size-of-incoming-io') / 'relative_throughput'
55
56 However, some optimizations below are used to reduce the calculation
57 as much as possible.
58
59 1. If the paths have the same 'relative_throughput', skip
60 the division and just compare the 'in-flight-size'.
61
62 2. If the paths have the same 'in-flight-size', skip the division
63 and just compare the 'relative_throughput'.
64
65 3. If some paths have non-zero 'relative_throughput' and others
66 have zero 'relative_throughput', ignore those paths with zero
67 'relative_throughput'.
68
69 If such optimizations can't be applied, calculate service time, and
70 compare service time.
71 If calculated service time is equal, the path having maximum
72 'relative_throughput' may be better. So compare 'relative_throughput'
73 then.
74
75
76 Examples
77 ========
78 In case that 2 paths (sda and sdb) are used with repeat_count == 128
79 and sda has an average throughput 1GB/s and sdb has 4GB/s,
80 'relative_throughput' value may be '1' for sda and '4' for sdb::
81
82 # echo "0 10 multipath 0 0 1 1 service-time 0 2 2 8:0 128 1 8:16 128 4" \
83 dmsetup create test
84 #
85 # dmsetup table
86 test: 0 10 multipath 0 0 1 1 service-time 0 2 2 8:0 128 1 8:16 128 4
87 #
88 # dmsetup status
89 test: 0 10 multipath 2 0 0 0 1 1 E 0 2 2 8:0 A 0 0 1 8:16 A 0 0 4
90
91
92 Or '2' for sda and '8' for sdb would be also true::
93
94 # echo "0 10 multipath 0 0 1 1 service-time 0 2 2 8:0 128 2 8:16 128 8" \
95 dmsetup create test
96 #
97 # dmsetup table
98 test: 0 10 multipath 0 0 1 1 service-time 0 2 2 8:0 128 2 8:16 128 8
99 #
100 # dmsetup status
101 test: 0 10 multipath 2 0 0 0 1 1 E 0 2 2 8:0 A 0 0 2 8:16 A 0 0 8
102

3. 한국어 전문 번역

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

추정 service time 기반 path 선택

1-15

`dm-service-time`은 incoming I/O의 예상 service time이 가장 짧은 path를 선택하는 device-mapper path selector module입니다.

각 path의 service time은 해당 path에 있는 in-flight I/O의 총크기를 path performance 값으로 나눠 추정합니다. Performance 값은 path-group 안의 모든 path 사이에서 정의한 상대 throughput이며 table 인자로 지정할 수 있습니다.

Service-time 추정 모델
Path별 in-flight I/O 총크기Incoming I/O 크기 더하기Relative throughput으로 나누기최소 추정 service time 선택

현재 queue byte 수와 새 I/O 크기를 상대 처리량으로 정규화해 path를 비교합니다.

Path selector 이름은 `service-time`입니다.

Path parameter와 status 필드

16-44

각 path에는 선택적인 `[<repeat_count> [<relative_throughput>]]` parameter를 지정할 수 있습니다.

    [<repeat_count> [<relative_throughput>]]
	<repeat_count>:
			The number of I/Os to dispatch using the selected
			path before switching to the next path.
			If not given, internal default is used.  To check
			the default value, see the activated table.
	<relative_throughput>:
			The relative throughput value of the path
			among all paths in the path-group.
			The valid range is 0-100.
			If not given, minimum value '1' is used.
			If '0' is given, the path isn't selected while
			other paths having a positive value are available.

`repeat_count`는 다음 path로 전환하기 전에 선택한 path로 dispatch할 I/O 수입니다. 생략하면 활성 table에서 확인할 수 있는 내부 기본값을 사용합니다.

`relative_throughput`은 path-group 안에서의 상대 처리량으로 유효 범위는 0~100이고 기본값은 최소값 1입니다. 0이면 양수 값을 가진 다른 path가 있는 동안 해당 path를 선택하지 않습니다.

각 path status는 `<status> <fail-count> <in-flight-size> <relative_throughput>` 형식입니다.

    <status> <fail-count> <in-flight-size> <relative_throughput>
	<status>:
		'A' if the path is active, 'F' if the path is failed.
	<fail-count>:
		The number of path failures.
	<in-flight-size>:
		The size of in-flight I/Os on the path.
	<relative_throughput>:
		The relative throughput value of the path
		among all paths in the path-group.
Service-time 설정과 status
필드의미
`repeat_count`Path 전환 전 dispatch할 I/O 수
`relative_throughput`Path-group 내 상대 처리량 0~100, 기본 1
`status``A`는 active, `F`는 failed
`fail-count`Path failure 횟수
`in-flight-size`Path에서 처리 중인 I/O 총크기

선택 빈도, 상대 성능, health와 현재 queue byte 수를 제공합니다.

계산식, 최적화와 tie-break

45-74

`dm-service-time`은 I/O dispatch 시 크기를 `in-flight-size`에 더하고 완료 시 뺍니다. 기본 선택식은 다음과 같습니다.

	('in-flight-size' + 'size-of-incoming-io') / 'relative_throughput'
Path 선택 최적화 순서
후보 path 비교Throughput이 같은가?예: `in-flight-size`만 비교
후보 path 비교In-flight 크기가 같은가?예: `relative_throughput`만 비교
양수 throughput path가 있는가?예: throughput 0 path 제외
최적화 불가Service time 계산·비교동률이면 최대 relative throughput 선택

불필요한 division을 피하고 필요한 경우에만 service time을 계산합니다.

	1. If the paths have the same 'relative_throughput', skip
	   the division and just compare the 'in-flight-size'.

	2. If the paths have the same 'in-flight-size', skip the division
	   and just compare the 'relative_throughput'.

	3. If some paths have non-zero 'relative_throughput' and others
	   have zero 'relative_throughput', ignore those paths with zero
	   'relative_throughput'.

두 path의 상대 throughput이 같으면 division 없이 `in-flight-size`만 비교합니다. In-flight 크기가 같으면 throughput만 비교합니다. 양수 throughput path와 0인 path가 섞여 있으면 0인 path를 제외합니다.

어떤 최적화도 적용할 수 없으면 service time을 실제 계산합니다. 계산값이 같다면 상대 throughput이 더 큰 path가 유리할 수 있으므로 이를 tie-break로 비교합니다.

1:4와 2:8 상대 throughput 예제

75-101

`sda`와 `sdb` 두 path에 `repeat_count=128`을 사용하고 평균 처리량이 각각 1 GB/s와 4 GB/s라면 상대 throughput을 1과 4로 지정할 수 있습니다.

  # echo "0 10 multipath 0 0 1 1 service-time 0 2 2 8:0 128 1 8:16 128 4" \
    dmsetup create test
  #
  # dmsetup table
  test: 0 10 multipath 0 0 1 1 service-time 0 2 2 8:0 128 1 8:16 128 4
  #
  # dmsetup status
  test: 0 10 multipath 2 0 0 0 1 1 E 0 2 2 8:0 A 0 0 1 8:16 A 0 0 4

상대값은 절대 대역폭이 아니라 비율이므로 같은 1:4 비율인 2와 8도 올바릅니다.

  # echo "0 10 multipath 0 0 1 1 service-time 0 2 2 8:0 128 2 8:16 128 8" \
    dmsetup create test
  #
  # dmsetup table
  test: 0 10 multipath 0 0 1 1 service-time 0 2 2 8:0 128 2 8:16 128 8
  #
  # dmsetup status
  test: 0 10 multipath 2 0 0 0 1 1 E 0 2 2 8:0 A 0 0 2 8:16 A 0 0 8
예제 path 설정
PathDeviceRepeat실측 평균표현 A표현 B
sda`8:0`1281 GB/s12
sdb`8:16`1284 GB/s48

동일한 1:4 처리량 비율은 배율이 달라도 같은 선택 가중치를 나타냅니다.

비율 보존
Throughput 1:4Weights 1:4또는 weights 2:8동일한 service-time 비율

Selector는 path-group 안의 상대값만 사용하므로 공통 배율은 결과를 바꾸지 않습니다.