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

Linux 6.18.37 · Administration / Device Mapper

dm-queue-length

In-flight I/O가 가장 적은 multipath 경로를 선택하는 queue-length selector의 parameter, status와 알고리즘입니다.

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

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

1. 요약·해설

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

선택 기준

dm-queue-length.rst:1-8

최소 in-flight I/O를 가진 active path를 선택합니다.

설정과 상태

dm-queue-length.rst:9-25

`repeat_count`와 status·failure·in-flight 필드를 설명합니다.

알고리즘과 예제

dm-queue-length.rst:26-48

Counter 갱신과 두 path multipath table·status 출력을 풀이합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 ===============
2 dm-queue-length
3 ===============
4
5 dm-queue-length is a path selector module for device-mapper targets,
6 which selects a path with the least number of in-flight I/Os.
7 The path selector name is 'queue-length'.
8
9 Table parameters for each path: [<repeat_count>]
10
11 ::
12
13 <repeat_count>: The number of I/Os to dispatch using the selected
14 path before switching to the next path.
15 If not given, internal default is used. To check
16 the default value, see the activated table.
17
18 Status for each path: <status> <fail-count> <in-flight>
19
20 ::
21
22 <status>: 'A' if the path is active, 'F' if the path is failed.
23 <fail-count>: The number of path failures.
24 <in-flight>: The number of in-flight I/Os on the path.
25
26
27 Algorithm
28 =========
29
30 dm-queue-length increments/decrements 'in-flight' when an I/O is
31 dispatched/completed respectively.
32 dm-queue-length selects a path with the minimum 'in-flight'.
33
34
35 Examples
36 ========
37 In case that 2 paths (sda and sdb) are used with repeat_count == 128.
38
39 ::
40
41 # echo "0 10 multipath 0 0 1 1 queue-length 0 2 1 8:0 128 8:16 128" \
42 dmsetup create test
43 #
44 # dmsetup table
45 test: 0 10 multipath 0 0 1 1 queue-length 0 2 1 8:0 128 8:16 128
46 #
47 # dmsetup status
48 test: 0 10 multipath 2 0 0 0 1 1 E 0 2 1 8:0 A 0 0 8:16 A 0 0
49

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`입니다.

queue-length path 선택
Active path 목록각 path의 `in-flight` 비교최솟값 path 선택I/O dispatch

사용 가능한 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.
Path parameter와 status 필드
필드의미
`repeat_count`Path 전환 전 같은 path에 보낼 I/O 수. 생략 시 내부 기본값
`status``A`는 active, `F`는 failed
`fail-count`해당 path의 실패 횟수
`in-flight`해당 path에서 처리 중인 I/O 수

설정값과 runtime 상태를 함께 정리합니다.

Dispatch·completion counter 알고리즘

26-33

`dm-queue-length`는 I/O를 dispatch할 때 해당 path의 `in-flight`를 증가시키고, I/O가 완료되면 감소시킵니다. 새 I/O에는 `in-flight` 값이 최소인 path를 선택합니다.

in-flight counter 생명주기
최소 `in-flight` path 선택Dispatch`in-flight + 1`I/O 처리Completion`in-flight - 1`

선택 순간의 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
예제 해석
항목
Selector`queue-length`
Path 수2
Path 1`8:0`, repeat 128, status `A`, fail 0, in-flight 0
Path 2`8:16`, repeat 128, status `A`, fail 0, in-flight 0

Table과 status 출력에서 selector, path와 runtime 상태를 확인합니다.