요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
설정과 상태
dm-queue-length.rst:9-25`repeat_count`와 status·failure·in-flight 필드를 설명합니다.
알고리즘과 예제
dm-queue-length.rst:26-48Counter 갱신과 두 path multipath table·status 출력을 풀이합니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
===============
dm-queue-length
===============
dm-queue-length is a path selector module for device-mapper targets,
which selects a path with the least number of in-flight I/Os.
The path selector name is 'queue-length'.
Table parameters for each path: [<repeat_count>]
::
<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.
Status for each path: <status> <fail-count> <in-flight>
::
<status>: 'A' if the path is active, 'F' if the path is failed.
<fail-count>: The number of path failures.
<in-flight>: The number of in-flight I/Os on the path.
Algorithm
=========
dm-queue-length increments/decrements 'in-flight' when an I/O is
dispatched/completed respectively.
dm-queue-length selects a path with the minimum 'in-flight'.
Examples
========
In case that 2 paths (sda and sdb) are used with repeat_count == 128.
::
# echo "0 10 multipath 0 0 1 1 queue-length 0 2 1 8:0 128 8:16 128" \
dmsetup create test
#
# dmsetup table
test: 0 10 multipath 0 0 1 1 queue-length 0 2 1 8:0 128 8:16 128
#
# dmsetup status
test: 0 10 multipath 2 0 0 0 1 1 E 0 2 1 8:0 A 0 0 8:16 A 0 0
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
최소 in-flight I/O path selector
1-8`dm-queue-length`는 device-mapper target용 path selector module로, 현재 처리 중인 in-flight I/O 수가 가장 적은 path를 선택합니다. Path selector 이름은 `queue-length`입니다.
사용 가능한 path의 현재 queue 깊이를 비교해 가장 덜 바쁜 경로를 선택합니다.
Path table parameter와 status
9-25각 path의 table parameter는 선택적인 `<repeat_count>`입니다.
<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.
`repeat_count`는 다음 path로 전환하기 전에 선택한 path로 dispatch할 I/O 수입니다. 생략하면 내부 기본값을 사용하며, 실제 기본값은 활성화된 table에서 확인할 수 있습니다.
각 path의 status는 `<status> <fail-count> <in-flight>` 형식입니다.
<status>: 'A' if the path is active, 'F' if the path is failed.
<fail-count>: The number of path failures.
<in-flight>: The number of in-flight I/Os on the path.
설정값과 runtime 상태를 함께 정리합니다.
Dispatch·completion counter 알고리즘
26-33`dm-queue-length`는 I/O를 dispatch할 때 해당 path의 `in-flight`를 증가시키고, I/O가 완료되면 감소시킵니다. 새 I/O에는 `in-flight` 값이 최소인 path를 선택합니다.
선택 순간의 queue 길이와 완료 반영으로 부하를 동적으로 분산합니다.
sda·sdb 두 path 예제
34-48다음 예는 `sda`와 `sdb`에 해당하는 `8:0`, `8:16` 두 path를 사용하고 각 path의 `repeat_count`를 128로 설정합니다.
# echo "0 10 multipath 0 0 1 1 queue-length 0 2 1 8:0 128 8:16 128" \
dmsetup create test
#
# dmsetup table
test: 0 10 multipath 0 0 1 1 queue-length 0 2 1 8:0 128 8:16 128
#
# dmsetup status
test: 0 10 multipath 2 0 0 0 1 1 E 0 2 1 8:0 A 0 0 8:16 A 0 0
Table과 status 출력에서 selector, path와 runtime 상태를 확인합니다.
선택 기준
dm-queue-length.rst:1-8최소 in-flight I/O를 가진 active path를 선택합니다.