요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
Parameter와 status
dm-service-time.rst:16-44`repeat_count`, 상대 throughput, health와 in-flight 크기를 설명합니다.
최적화와 예제
dm-service-time.rst:45-101Division 회피 규칙, tie-break와 같은 1:4 비율의 두 표현을 풀이합니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
===============
dm-service-time
===============
dm-service-time is a path selector module for device-mapper targets,
which selects a path with the shortest estimated service time for
the incoming I/O.
The service time for each path is estimated by dividing the total size
of in-flight I/Os on a path with the performance value of the path.
The performance value is a relative throughput value among all paths
in a path-group, and it can be specified as a table argument.
The path selector name is 'service-time'.
Table parameters for each path:
[<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.
Status for each path:
<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.
Algorithm
=========
dm-service-time adds the I/O size to 'in-flight-size' when the I/O is
dispatched and subtracts when completed.
Basically, dm-service-time selects a path having minimum service time
which is calculated by::
('in-flight-size' + 'size-of-incoming-io') / 'relative_throughput'
However, some optimizations below are used to reduce the calculation
as much as possible.
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'.
If such optimizations can't be applied, calculate service time, and
compare service time.
If calculated service time is equal, the path having maximum
'relative_throughput' may be better. So compare 'relative_throughput'
then.
Examples
========
In case that 2 paths (sda and sdb) are used with repeat_count == 128
and sda has an average throughput 1GB/s and sdb has 4GB/s,
'relative_throughput' value may be '1' for sda and '4' for sdb::
# 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
Or '2' for sda and '8' for sdb would be also true::
# 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
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 인자로 지정할 수 있습니다.
현재 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.
선택 빈도, 상대 성능, 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'
불필요한 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
동일한 1:4 처리량 비율은 배율이 달라도 같은 선택 가중치를 나타냅니다.
Selector는 path-group 안의 상대값만 사용하므로 공통 배율은 결과를 바꾸지 않습니다.
Service-time 모델
dm-service-time.rst:1-15Queue 크기를 상대 처리량으로 정규화해 최소 예상 시간 path를 고릅니다.