xref: /linux/Documentation/admin-guide/device-mapper/dm-queue-length.rst (revision 6cf2a73cb2bc422a03984b285a63632c27f8c4e4)
1*f0ba4377SMauro Carvalho Chehab===============
2fd5e0339SKiyoshi Uedadm-queue-length
3fd5e0339SKiyoshi Ueda===============
4fd5e0339SKiyoshi Ueda
5fd5e0339SKiyoshi Uedadm-queue-length is a path selector module for device-mapper targets,
6fd5e0339SKiyoshi Uedawhich selects a path with the least number of in-flight I/Os.
7fd5e0339SKiyoshi UedaThe path selector name is 'queue-length'.
8fd5e0339SKiyoshi Ueda
9fd5e0339SKiyoshi UedaTable parameters for each path: [<repeat_count>]
10*f0ba4377SMauro Carvalho Chehab
11*f0ba4377SMauro Carvalho Chehab::
12*f0ba4377SMauro Carvalho Chehab
13fd5e0339SKiyoshi Ueda	<repeat_count>: The number of I/Os to dispatch using the selected
14fd5e0339SKiyoshi Ueda			path before switching to the next path.
15fd5e0339SKiyoshi Ueda			If not given, internal default is used. To check
16fd5e0339SKiyoshi Ueda			the default value, see the activated table.
17fd5e0339SKiyoshi Ueda
18fd5e0339SKiyoshi UedaStatus for each path: <status> <fail-count> <in-flight>
19*f0ba4377SMauro Carvalho Chehab
20*f0ba4377SMauro Carvalho Chehab::
21*f0ba4377SMauro Carvalho Chehab
22fd5e0339SKiyoshi Ueda	<status>: 'A' if the path is active, 'F' if the path is failed.
23fd5e0339SKiyoshi Ueda	<fail-count>: The number of path failures.
24fd5e0339SKiyoshi Ueda	<in-flight>: The number of in-flight I/Os on the path.
25fd5e0339SKiyoshi Ueda
26fd5e0339SKiyoshi Ueda
27fd5e0339SKiyoshi UedaAlgorithm
28fd5e0339SKiyoshi Ueda=========
29fd5e0339SKiyoshi Ueda
30fd5e0339SKiyoshi Uedadm-queue-length increments/decrements 'in-flight' when an I/O is
31fd5e0339SKiyoshi Uedadispatched/completed respectively.
32fd5e0339SKiyoshi Uedadm-queue-length selects a path with the minimum 'in-flight'.
33fd5e0339SKiyoshi Ueda
34fd5e0339SKiyoshi Ueda
35fd5e0339SKiyoshi UedaExamples
36fd5e0339SKiyoshi Ueda========
37fd5e0339SKiyoshi UedaIn case that 2 paths (sda and sdb) are used with repeat_count == 128.
38fd5e0339SKiyoshi Ueda
39*f0ba4377SMauro Carvalho Chehab::
40*f0ba4377SMauro Carvalho Chehab
41fd5e0339SKiyoshi Ueda  # echo "0 10 multipath 0 0 1 1 queue-length 0 2 1 8:0 128 8:16 128" \
42fd5e0339SKiyoshi Ueda    dmsetup create test
43fd5e0339SKiyoshi Ueda  #
44fd5e0339SKiyoshi Ueda  # dmsetup table
45fd5e0339SKiyoshi Ueda  test: 0 10 multipath 0 0 1 1 queue-length 0 2 1 8:0 128 8:16 128
46fd5e0339SKiyoshi Ueda  #
47fd5e0339SKiyoshi Ueda  # dmsetup status
48fd5e0339SKiyoshi Ueda  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