← Documents Documentation/admin-guide/device-mapper/vdo.rst GitHub 원문 ↗

Linux 6.18.37 · Administration / Device Mapper

dm-vdo

dm-vdo target table, thread·discard option, online resize, messages와 status, memory 산식 및 production tuning을 설명합니다.

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

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

1. 요약·해설

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

Target interface

vdo.rst:1-191

Userspace 도구와 metadata 비용, 필수 table parameter 및 thread·discard·resize 제약을 단위와 범위 중심으로 정리합니다.

Operations

vdo.rst:192-335

생성·확장 예제, device message와 status field, capacity별 RAM 요구량을 다룹니다.

Runtime and tuning

vdo.rst:336-413

Shared block·thin provisioning의 운영 특성과 cache, zone thread, submission·ack·CPU·hash thread tuning 기준을 설명합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0-only
2
3 ======
4 dm-vdo
5 ======
6
7 The dm-vdo (virtual data optimizer) device mapper target provides
8 block-level deduplication, compression, and thin provisioning. As a device
9 mapper target, it can add these features to the storage stack, compatible
10 with any file system. The vdo target does not protect against data
11 corruption, relying instead on integrity protection of the storage below
12 it. It is strongly recommended that lvm be used to manage vdo volumes. See
13 lvmvdo(7).
14
15 Userspace component
16 ===================
17
18 Formatting a vdo volume requires the use of the 'vdoformat' tool, available
19 at:
20
21 https://github.com/dm-vdo/vdo/
22
23 In most cases, a vdo target will recover from a crash automatically the
24 next time it is started. In cases where it encountered an unrecoverable
25 error (either during normal operation or crash recovery) the target will
26 enter or come up in read-only mode. Because read-only mode is indicative of
27 data-loss, a positive action must be taken to bring vdo out of read-only
28 mode. The 'vdoforcerebuild' tool, available from the same repo, is used to
29 prepare a read-only vdo to exit read-only mode. After running this tool,
30 the vdo target will rebuild its metadata the next time it is
31 started. Although some data may be lost, the rebuilt vdo's metadata will be
32 internally consistent and the target will be writable again.
33
34 The repo also contains additional userspace tools which can be used to
35 inspect a vdo target's on-disk metadata. Fortunately, these tools are
36 rarely needed except by dm-vdo developers.
37
38 Metadata requirements
39 =====================
40
41 Each vdo volume reserves 3GB of space for metadata, or more depending on
42 its configuration. It is helpful to check that the space saved by
43 deduplication and compression is not cancelled out by the metadata
44 requirements. An estimation of the space saved for a specific dataset can
45 be computed with the vdo estimator tool, which is available at:
46
47 https://github.com/dm-vdo/vdoestimator/
48
49 Target interface
50 ================
51
52 Table line
53 ----------
54
55 ::
56
57 <offset> <logical device size> vdo V4 <storage device>
58 <storage device size> <minimum I/O size> <block map cache size>
59 <block map era length> [optional arguments]
60
61
62 Required parameters:
63
64 offset:
65 The offset, in sectors, at which the vdo volume's logical
66 space begins.
67
68 logical device size:
69 The size of the device which the vdo volume will service,
70 in sectors. Must match the current logical size of the vdo
71 volume.
72
73 storage device:
74 The device holding the vdo volume's data and metadata.
75
76 storage device size:
77 The size of the device holding the vdo volume, as a number
78 of 4096-byte blocks. Must match the current size of the vdo
79 volume.
80
81 minimum I/O size:
82 The minimum I/O size for this vdo volume to accept, in
83 bytes. Valid values are 512 or 4096. The recommended value
84 is 4096.
85
86 block map cache size:
87 The size of the block map cache, as a number of 4096-byte
88 blocks. The minimum and recommended value is 32768 blocks.
89 If the logical thread count is non-zero, the cache size
90 must be at least 4096 blocks per logical thread.
91
92 block map era length:
93 The speed with which the block map cache writes out
94 modified block map pages. A smaller era length is likely to
95 reduce the amount of time spent rebuilding, at the cost of
96 increased block map writes during normal operation. The
97 maximum and recommended value is 16380; the minimum value
98 is 1.
99
100 Optional parameters:
101 --------------------
102 Some or all of these parameters may be specified as <key> <value> pairs.
103
104 Thread related parameters:
105
106 Different categories of work are assigned to separate thread groups, and
107 the number of threads in each group can be configured separately.
108
109 If <hash>, <logical>, and <physical> are all set to 0, the work handled by
110 all three thread types will be handled by a single thread. If any of these
111 values are non-zero, all of them must be non-zero.
112
113 ack:
114 The number of threads used to complete bios. Since
115 completing a bio calls an arbitrary completion function
116 outside the vdo volume, threads of this type allow the vdo
117 volume to continue processing requests even when bio
118 completion is slow. The default is 1.
119
120 bio:
121 The number of threads used to issue bios to the underlying
122 storage. Threads of this type allow the vdo volume to
123 continue processing requests even when bio submission is
124 slow. The default is 4.
125
126 bioRotationInterval:
127 The number of bios to enqueue on each bio thread before
128 switching to the next thread. The value must be greater
129 than 0 and not more than 1024; the default is 64.
130
131 cpu:
132 The number of threads used to do CPU-intensive work, such
133 as hashing and compression. The default is 1.
134
135 hash:
136 The number of threads used to manage data comparisons for
137 deduplication based on the hash value of data blocks. The
138 default is 0.
139
140 logical:
141 The number of threads used to manage caching and locking
142 based on the logical address of incoming bios. The default
143 is 0; the maximum is 60.
144
145 physical:
146 The number of threads used to manage administration of the
147 underlying storage device. At format time, a slab size for
148 the vdo is chosen; the vdo storage device must be large
149 enough to have at least 1 slab per physical thread. The
150 default is 0; the maximum is 16.
151
152 Miscellaneous parameters:
153
154 maxDiscard:
155 The maximum size of discard bio accepted, in 4096-byte
156 blocks. I/O requests to a vdo volume are normally split
157 into 4096-byte blocks, and processed up to 2048 at a time.
158 However, discard requests to a vdo volume can be
159 automatically split to a larger size, up to <maxDiscard>
160 4096-byte blocks in a single bio, and are limited to 1500
161 at a time. Increasing this value may provide better overall
162 performance, at the cost of increased latency for the
163 individual discard requests. The default and minimum is 1;
164 the maximum is UINT_MAX / 4096.
165
166 deduplication:
167 Whether deduplication is enabled. The default is 'on'; the
168 acceptable values are 'on' and 'off'.
169
170 compression:
171 Whether compression is enabled. The default is 'off'; the
172 acceptable values are 'on' and 'off'.
173
174 Device modification
175 -------------------
176
177 A modified table may be loaded into a running, non-suspended vdo volume.
178 The modifications will take effect when the device is next resumed. The
179 modifiable parameters are <logical device size>, <physical device size>,
180 <maxDiscard>, <compression>, and <deduplication>.
181
182 If the logical device size or physical device size are changed, upon
183 successful resume vdo will store the new values and require them on future
184 startups. These two parameters may not be decreased. The logical device
185 size may not exceed 4 PB. The physical device size must increase by at
186 least 32832 4096-byte blocks if at all, and must not exceed the size of the
187 underlying storage device. Additionally, when formatting the vdo device, a
188 slab size is chosen: the physical device size may never increase above the
189 size which provides 8192 slabs, and each increase must be large enough to
190 add at least one new slab.
191
192 Examples:
193
194 Start a previously-formatted vdo volume with 1 GB logical space and 1 GB
195 physical space, storing to /dev/dm-1 which has more than 1 GB of space.
196
197 ::
198
199 dmsetup create vdo0 --table \
200 "0 2097152 vdo V4 /dev/dm-1 262144 4096 32768 16380"
201
202 Grow the logical size to 4 GB.
203
204 ::
205
206 dmsetup reload vdo0 --table \
207 "0 8388608 vdo V4 /dev/dm-1 262144 4096 32768 16380"
208 dmsetup resume vdo0
209
210 Grow the physical size to 2 GB.
211
212 ::
213
214 dmsetup reload vdo0 --table \
215 "0 8388608 vdo V4 /dev/dm-1 524288 4096 32768 16380"
216 dmsetup resume vdo0
217
218 Grow the physical size by 1 GB more and increase max discard sectors.
219
220 ::
221
222 dmsetup reload vdo0 --table \
223 "0 10485760 vdo V4 /dev/dm-1 786432 4096 32768 16380 maxDiscard 8"
224 dmsetup resume vdo0
225
226 Stop the vdo volume.
227
228 ::
229
230 dmsetup remove vdo0
231
232 Start the vdo volume again. Note that the logical and physical device sizes
233 must still match, but other parameters can change.
234
235 ::
236
237 dmsetup create vdo1 --table \
238 "0 10485760 vdo V4 /dev/dm-1 786432 512 65550 5000 hash 1 logical 3 physical 2"
239
240 Messages
241 --------
242 All vdo devices accept messages in the form:
243
244 ::
245
246 dmsetup message <target-name> 0 <message-name> <message-parameters>
247
248 The messages are:
249
250 stats:
251 Outputs the current view of the vdo statistics. Mostly used
252 by the vdostats userspace program to interpret the output
253 buffer.
254
255 config:
256 Outputs useful vdo configuration information. Mostly used
257 by users who want to recreate a similar VDO volume and
258 want to know the creation configuration used.
259
260 dump:
261 Dumps many internal structures to the system log. This is
262 not always safe to run, so it should only be used to debug
263 a hung vdo. Optional parameters to specify structures to
264 dump are:
265
266 viopool: The pool of I/O requests incoming bios
267 pools: A synonym of 'viopool'
268 vdo: Most of the structures managing on-disk data
269 queues: Basic information about each vdo thread
270 threads: A synonym of 'queues'
271 default: Equivalent to 'queues vdo'
272 all: All of the above.
273
274 dump-on-shutdown:
275 Perform a default dump next time vdo shuts down.
276
277
278 Status
279 ------
280
281 ::
282
283 <device> <operating mode> <in recovery> <index state>
284 <compression state> <physical blocks used> <total physical blocks>
285
286 device:
287 The name of the vdo volume.
288
289 operating mode:
290 The current operating mode of the vdo volume; values may be
291 'normal', 'recovering' (the volume has detected an issue
292 with its metadata and is attempting to repair itself), and
293 'read-only' (an error has occurred that forces the vdo
294 volume to only support read operations and not writes).
295
296 in recovery:
297 Whether the vdo volume is currently in recovery mode;
298 values may be 'recovering' or '-' which indicates not
299 recovering.
300
301 index state:
302 The current state of the deduplication index in the vdo
303 volume; values may be 'closed', 'closing', 'error',
304 'offline', 'online', 'opening', and 'unknown'.
305
306 compression state:
307 The current state of compression in the vdo volume; values
308 may be 'offline' and 'online'.
309
310 used physical blocks:
311 The number of physical blocks in use by the vdo volume.
312
313 total physical blocks:
314 The total number of physical blocks the vdo volume may use;
315 the difference between this value and the
316 <used physical blocks> is the number of blocks the vdo
317 volume has left before being full.
318
319 Memory Requirements
320 ===================
321
322 A vdo target requires a fixed 38 MB of RAM along with the following amounts
323 that scale with the target:
324
325 - 1.15 MB of RAM for each 1 MB of configured block map cache size. The
326 block map cache requires a minimum of 150 MB.
327 - 1.6 MB of RAM for each 1 TB of logical space.
328 - 268 MB of RAM for each 1 TB of physical storage managed by the volume.
329
330 The deduplication index requires additional memory which scales with the
331 size of the deduplication window. For dense indexes, the index requires 1
332 GB of RAM per 1 TB of window. For sparse indexes, the index requires 1 GB
333 of RAM per 10 TB of window. The index configuration is set when the target
334 is formatted and may not be modified.
335
336 Module Parameters
337 =================
338
339 The vdo driver has a numeric parameter 'log_level' which controls the
340 verbosity of logging from the driver. The default setting is 6
341 (LOGLEVEL_INFO and more severe messages).
342
343 Run-time Usage
344 ==============
345
346 When using dm-vdo, it is important to be aware of the ways in which its
347 behavior differs from other storage targets.
348
349 - There is no guarantee that over-writes of existing blocks will succeed.
350 Because the underlying storage may be multiply referenced, over-writing
351 an existing block generally requires a vdo to have a free block
352 available.
353
354 - When blocks are no longer in use, sending a discard request for those
355 blocks lets the vdo release references for those blocks. If the vdo is
356 thinly provisioned, discarding unused blocks is essential to prevent the
357 target from running out of space. However, due to the sharing of
358 duplicate blocks, no discard request for any given logical block is
359 guaranteed to reclaim space.
360
361 - Assuming the underlying storage properly implements flush requests, vdo
362 is resilient against crashes, however, unflushed writes may or may not
363 persist after a crash.
364
365 - Each write to a vdo target entails a significant amount of processing.
366 However, much of the work is paralellizable. Therefore, vdo targets
367 achieve better throughput at higher I/O depths, and can support up 2048
368 requests in parallel.
369
370 Tuning
371 ======
372
373 The vdo device has many options, and it can be difficult to make optimal
374 choices without perfect knowledge of the workload. Additionally, most
375 configuration options must be set when a vdo target is started, and cannot
376 be changed without shutting it down completely; the configuration cannot be
377 changed while the target is active. Ideally, tuning with simulated
378 workloads should be performed before deploying vdo in production
379 environments.
380
381 The most important value to adjust is the block map cache size. In order to
382 service a request for any logical address, a vdo must load the portion of
383 the block map which holds the relevant mapping. These mappings are cached.
384 Performance will suffer when the working set does not fit in the cache. By
385 default, a vdo allocates 128 MB of metadata cache in RAM to support
386 efficient access to 100 GB of logical space at a time. It should be scaled
387 up proportionally for larger working sets.
388
389 The logical and physical thread counts should also be adjusted. A logical
390 thread controls a disjoint section of the block map, so additional logical
391 threads increase parallelism and can increase throughput. Physical threads
392 control a disjoint section of the data blocks, so additional physical
393 threads can also increase throughput. However, excess threads can waste
394 resources and increase contention.
395
396 Bio submission threads control the parallelism involved in sending I/O to
397 the underlying storage; fewer threads mean there is more opportunity to
398 reorder I/O requests for performance benefit, but also that each I/O
399 request has to wait longer before being submitted.
400
401 Bio acknowledgment threads are used for finishing I/O requests. This is
402 done on dedicated threads since the amount of work required to execute a
403 bio's callback can not be controlled by the vdo itself. Usually one thread
404 is sufficient but additional threads may be beneficial, particularly when
405 bios have CPU-heavy callbacks.
406
407 CPU threads are used for hashing and for compression; in workloads with
408 compression enabled, more threads may result in higher throughput.
409
410 Hash threads are used to sort active requests by hash and determine whether
411 they should deduplicate; the most CPU intensive actions done by these
412 threads are comparison of 4096-byte data blocks. In most cases, a single
413 hash thread is sufficient.
414

3. 한국어 전문 번역

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

dm-vdo와 userspace 도구

1-37

`dm-vdo`(virtual data optimizer) device-mapper target은 block-level deduplication, compression, thin provisioning을 제공합니다. Device-mapper target이므로 모든 file system과 호환되면서 storage stack에 이 기능을 추가할 수 있습니다.

vdo target 자체는 data corruption을 방지하지 않으며 아래 storage 계층의 integrity protection에 의존합니다. vdo volume 관리는 LVM을 사용하는 것을 강력히 권장합니다. `lvmvdo(7)`를 참조하십시오.

vdo volume을 format하려면 다음 저장소에서 제공하는 `vdoformat` 도구가 필요합니다: `https://github.com/dm-vdo/vdo/`.

대부분의 경우 vdo target은 crash 뒤 다음 시작 때 자동으로 복구합니다. 정상 동작 또는 crash recovery 중 복구할 수 없는 error를 만나면 target은 read-only mode로 들어가거나 그 mode로 시작합니다. Read-only mode는 data loss를 의미하므로 이를 벗어나려면 명시적인 조치가 필요합니다.

같은 저장소의 `vdoforcerebuild` 도구는 read-only vdo가 이 mode를 벗어나도록 준비합니다. 도구 실행 후 다음 시작 때 vdo target이 metadata를 rebuild합니다. Data 일부를 잃을 수 있지만 rebuild된 metadata는 내부적으로 일관되고 target은 다시 writable 상태가 됩니다.

저장소에는 vdo target의 on-disk metadata를 검사하는 추가 userspace 도구도 있습니다. 다행히 dm-vdo developer 외에는 이런 도구가 필요한 경우가 드뭅니다.

Read-only recovery 절차
Unrecoverable errorRead-only mode`vdoforcerebuild` 명시적 실행다음 start에서 metadata rebuildWritable·internally consistent

Data loss 가능성이 있으므로 rebuild는 자동으로 수행되지 않습니다.

Metadata와 필수 table parameter

38-99

각 vdo volume은 metadata용으로 3GB 이상을 예약하며 정확한 양은 configuration에 따라 늘어납니다. Deduplication과 compression으로 절약한 공간이 metadata 요구량 때문에 상쇄되지 않는지 확인하는 것이 좋습니다. 특정 dataset의 예상 절약량은 `https://github.com/dm-vdo/vdoestimator/`의 vdo estimator 도구로 계산할 수 있습니다.

Target table line 형식은 다음과 같습니다.

::

	<offset> <logical device size> vdo V4 <storage device>
	<storage device size> <minimum I/O size> <block map cache size>
	<block map era length> [optional arguments]
필수 table parameter
Parameter의미제약·권장값
`offset`Logical space가 시작하는 offsetSector 단위
`logical device size`vdo가 service할 device sizeSector 단위, 현재 logical size와 일치
`storage device`Data와 metadata를 담는 deviceBlock device path
`storage device size`vdo volume을 담는 device size4096-byte block 수, 현재 physical size와 일치
`minimum I/O size`허용할 최소 I/O512 또는 4096 byte, 4096 권장
`block map cache size`Block map cache 크기4096-byte block 수, 최소·권장 32768
`block map era length`Dirty block map page 기록 속도1~16380, 최대값 16380 권장

Sector 단위와 4096-byte block 단위가 섞이므로 각 parameter 단위를 구분해야 합니다.

`offset`은 vdo volume의 logical space가 시작하는 sector offset입니다. `logical device size`는 vdo volume이 service할 device의 sector 수이며 현재 volume logical size와 반드시 일치해야 합니다. `storage device`는 volume data와 metadata를 보관하는 device입니다.

`storage device size`는 vdo volume을 담는 device의 크기를 4096-byte block 수로 나타내며 현재 vdo volume size와 일치해야 합니다. `minimum I/O size`는 volume이 받을 최소 byte 수로 512와 4096만 유효하며 4096을 권장합니다.

`block map cache size`는 4096-byte block 수로 표현합니다. 최소값이자 권장값은 32768 block입니다. Logical thread count가 0이 아니면 logical thread마다 최소 4096 block이 필요합니다.

`block map era length`는 block map cache가 수정된 block map page를 기록하는 속도를 결정합니다. 값이 작으면 정상 동작 중 block map write가 늘어나는 대신 rebuild 시간이 줄어들 가능성이 큽니다. 최대값이자 권장값은 16380이고 최소값은 1입니다.

Optional thread parameter

100-151

Optional parameter는 일부 또는 전부를 `<key> <value>` 쌍으로 지정할 수 있습니다. 서로 다른 작업 category는 별도 thread group에 배정되며 group별 thread 수를 독립적으로 구성할 수 있습니다.

`hash`, `logical`, `physical`이 모두 0이면 세 thread type의 작업을 단일 thread가 처리합니다. 이 값 중 하나라도 0이 아니면 세 값 모두 0이 아니어야 합니다.

Thread parameter
Key역할기본값범위·조건
`ack`Bio completion callback 실행1Slow callback 격리
`bio`Underlying storage에 bio 제출4Slow submission 격리
`bioRotationInterval`Bio thread 전환 전 enqueue 수641~1024
`cpu`Hashing과 compression1CPU-intensive work
`hash`Block hash 기반 dedup 비교 관리0hash/logical/physical 함께 0 또는 모두 non-zero
`logical`Logical address 기반 cache·lock0최대 60
`physical`Underlying storage 관리0최대 16, thread당 slab 최소 1개

I/O completion·submission, CPU work와 세 zone owner group을 조정합니다.

`ack`는 bio 완료에 사용하는 thread 수입니다. Bio completion은 vdo volume 밖의 임의 completion function을 호출하므로 callback이 느려도 volume이 request 처리를 계속할 수 있게 합니다. 기본값은 1입니다.

`bio`는 underlying storage에 bio를 발행하는 thread 수입니다. Bio submission이 느려도 volume이 request 처리를 계속하게 하며 기본값은 4입니다. `bioRotationInterval`은 다음 bio thread로 전환하기 전에 각 thread에 enqueue할 bio 수입니다. 0보다 크고 1024 이하여야 하며 기본값은 64입니다.

`cpu`는 hashing과 compression 같은 CPU-intensive work에 쓰는 thread 수이며 기본값은 1입니다. `hash`는 data block hash value에 따라 deduplication용 data comparison을 관리하는 thread 수이며 기본값은 0입니다.

`logical`은 incoming bio의 logical address를 기준으로 caching과 locking을 관리하는 thread 수입니다. 기본값은 0이고 최대값은 60입니다.

`physical`은 underlying storage device 관리를 담당하는 thread 수입니다. Format 때 vdo slab size가 결정되며 storage device에는 physical thread마다 최소 slab 하나가 있을 만큼 공간이 있어야 합니다. 기본값은 0이고 최대값은 16입니다.

Discard·최적화 option과 device 변경

152-191

`maxDiscard`는 vdo가 받을 discard bio의 최대 크기를 4096-byte block 수로 지정합니다. 일반 I/O request는 보통 4096-byte block으로 분할되어 한 번에 최대 2048개를 처리합니다. 그러나 discard request는 단일 bio에서 최대 `<maxDiscard>`개의 4096-byte block까지 더 크게 자동 분할할 수 있고 동시에 처리하는 수는 1500개로 제한됩니다.

`maxDiscard`를 늘리면 개별 discard request latency가 증가하는 대신 전체 성능이 좋아질 수 있습니다. 기본값이자 최소값은 1이고 최대값은 `UINT_MAX / 4096`입니다.

`deduplication`은 deduplication 활성화 여부이며 기본값은 `on`, 허용값은 `on`과 `off`입니다. `compression`은 compression 활성화 여부이며 기본값은 `off`, 허용값은 `on`과 `off`입니다.

실행 중이며 suspend되지 않은 vdo volume에 수정된 table을 load할 수 있습니다. 변경은 device를 다음에 resume할 때 적용됩니다. 수정 가능한 parameter는 `logical device size`, `physical device size`, `maxDiscard`, `compression`, `deduplication`입니다.

Logical 또는 physical device size를 변경하고 resume이 성공하면 vdo는 새 값을 저장하고 이후 시작 때 그 값을 요구합니다. 두 size는 줄일 수 없으며 logical device size는 4PB를 넘을 수 없습니다.

Physical device size는 변경한다면 최소 32832개의 4096-byte block만큼 늘려야 하고 underlying storage device size를 넘을 수 없습니다. Format 때 slab size가 정해지므로 physical size는 slab 8192개를 제공하는 크기를 넘을 수 없고, 각 증가는 새 slab을 최소 하나 추가할 만큼 커야 합니다.

실행 중 변경과 resize 제약
항목변경 가능주요 제약
Logical size증가만최대 4PB
Physical size증가만최소 +32832 block, 최대 8192 slab, 증가당 slab 1개 이상
`maxDiscard`가능1~UINT_MAX / 4096
`compression`가능on/off
`deduplication`가능on/off

Reload 뒤 resume할 때 적용되며 size 증가는 persistent contract가 됩니다.

생성·확장·재시작 예제

192-239

1GB보다 큰 `/dev/dm-1`에 저장하면서 logical space와 physical space가 각각 1GB인, 미리 format된 vdo volume을 시작합니다.

::

	dmsetup create vdo0 --table \
	"0 2097152 vdo V4 /dev/dm-1 262144 4096 32768 16380"

Logical size를 4GB로 확장합니다.

::

	dmsetup reload vdo0 --table \
	"0 8388608 vdo V4 /dev/dm-1 262144 4096 32768 16380"
	dmsetup resume vdo0

Physical size를 2GB로 확장합니다.

::

	dmsetup reload vdo0 --table \
	"0 8388608 vdo V4 /dev/dm-1 524288 4096 32768 16380"
	dmsetup resume vdo0

Physical size를 1GB 더 늘리고 maximum discard sector도 증가시킵니다.

::

	dmsetup reload vdo0 --table \
	"0 10485760 vdo V4 /dev/dm-1 786432 4096 32768 16380 maxDiscard 8"
	dmsetup resume vdo0

vdo volume을 중지합니다.

::

	dmsetup remove vdo0

vdo volume을 다시 시작합니다. Logical·physical device size는 저장된 값과 계속 일치해야 하지만 다른 parameter는 바꿀 수 있습니다.

::

	dmsetup create vdo1 --table \
	"0 10485760 vdo V4 /dev/dm-1 786432 512 65550 5000 hash 1 logical 3 physical 2"
Online resize sequence
`dmsetup reload vdo0 --table ...``dmsetup resume vdo0`새 logical/physical size 저장이후 start에서 동일값 요구

Size를 늘리는 table을 reload하고 resume하여 새 persistent geometry를 확정합니다.

Device message

240-277

모든 vdo device는 다음 형식의 message를 받습니다.

::

        dmsetup message <target-name> 0 <message-name> <message-parameters>
VDO message
Message동작
`stats`현재 vdo statistics 출력, 주로 `vdostats`가 해석
`config`유사 volume 재생성에 필요한 creation configuration 출력
`dump`내부 structure를 system log에 dump
`dump-on-shutdown`다음 shutdown 때 default dump 수행

상태 조회와 debugging dump를 target message interface로 요청합니다.

`stats`는 vdo statistics의 현재 view를 출력하며 주로 `vdostats` userspace program이 output buffer를 해석할 때 사용합니다. `config`는 유용한 vdo configuration 정보를 출력하며 같은 형태의 VDO volume을 재현하기 위해 사용된 creation configuration을 알고 싶은 사용자에게 유용합니다.

`dump`는 많은 internal structure를 system log에 출력합니다. 항상 안전한 작업은 아니므로 멈춘 vdo를 debug할 때만 사용해야 합니다.

선택 가능한 dump structure는 `viopool`(incoming bio I/O request pool), 그 동의어 `pools`, on-disk data를 관리하는 대부분의 structure인 `vdo`, 각 vdo thread 기본 정보인 `queues`, 그 동의어 `threads`, `queues vdo`와 같은 `default`, 위 항목 전체인 `all`입니다.

`dump-on-shutdown`은 다음 vdo shutdown 때 default dump를 수행하게 합니다.

Target status 형식

278-318

Status line 형식은 다음과 같습니다.

::

    <device> <operating mode> <in recovery> <index state>
    <compression state> <physical blocks used> <total physical blocks>

`device`는 vdo volume 이름입니다. `operating mode`는 현재 동작 mode로 `normal`, metadata 문제를 감지해 자체 repair를 시도하는 `recovering`, error 때문에 read만 지원하고 write를 막는 `read-only` 중 하나입니다.

`in recovery`는 현재 recovery mode인지 나타내며 값은 `recovering` 또는 recovery 중이 아님을 뜻하는 `-`입니다.

`index state`는 deduplication index의 현재 상태이며 `closed`, `closing`, `error`, `offline`, `online`, `opening`, `unknown` 중 하나입니다. `compression state`는 compression의 현재 상태이며 `offline` 또는 `online`입니다.

`used physical blocks`는 volume이 사용하는 physical block 수입니다. `total physical blocks`는 volume이 사용할 수 있는 총 physical block 수입니다. Total에서 used를 뺀 값이 volume이 가득 차기 전에 남은 block 수입니다.

Status field와 값
Field가능한 값 또는 의미
DeviceVDO volume name
Operating modenormal / recovering / read-only
In recoveryrecovering / -
Index stateclosed / closing / error / offline / online / opening / unknown
Compression stateoffline / online
Physical blocksused / total

Operating state, recovery/index/compression state와 capacity를 한 line에 제공합니다.

RAM 요구량

319-335

vdo target에는 고정 38MB RAM과 target 규모에 따라 증가하는 다음 memory가 필요합니다.

구성한 block map cache 1MB마다 RAM 1.15MB가 필요하며 block map cache 자체는 최소 150MB가 필요합니다. Logical space 1TB마다 RAM 1.6MB, volume이 관리하는 physical storage 1TB마다 RAM 268MB가 필요합니다.

Deduplication index에는 deduplication window 크기에 비례하는 추가 memory가 필요합니다. Dense index는 window 1TB마다 RAM 1GB, sparse index는 window 10TB마다 RAM 1GB가 필요합니다. Index configuration은 target format 때 설정하며 변경할 수 없습니다.

VDO RAM 산식
구성 요소RAM 요구량
Target base38MB 고정
Block map cacheConfigured cache 1MB당 1.15MB, cache 최소 150MB
Logical space1TB당 1.6MB
Physical storage1TB당 268MB
Dense indexWindow 1TB당 1GB
Sparse indexWindow 10TB당 1GB

고정 비용, cache와 logical·physical capacity, index window 비용을 합산합니다.

Module parameter와 run-time 특성

336-369

vdo driver의 numeric module parameter `log_level`은 driver logging verbosity를 제어합니다. 기본값은 6으로 `LOGLEVEL_INFO`와 그보다 심각한 message를 출력합니다.

dm-vdo 사용 시 다른 storage target과 다른 동작을 이해해야 합니다.

기존 block overwrite가 성공한다고 보장할 수 없습니다. Underlying storage가 여러 logical block에서 함께 참조될 수 있으므로 기존 block을 overwrite하려면 일반적으로 vdo에 free block이 하나 있어야 합니다.

더는 사용하지 않는 block에 discard request를 보내면 vdo가 그 block의 reference를 해제할 수 있습니다. Thin provisioning 환경에서는 target의 공간 고갈을 막기 위해 unused block discard가 필수적입니다. 그러나 duplicate block 공유 때문에 특정 logical block의 discard가 실제 공간을 회수한다고 보장할 수 없습니다.

Underlying storage가 flush request를 올바르게 구현한다면 vdo는 crash에 견딜 수 있습니다. 다만 flush되지 않은 write는 crash 후 남을 수도 있고 사라질 수도 있습니다.

vdo target에 write할 때마다 상당한 처리가 필요하지만 많은 작업은 parallel하게 수행할 수 있습니다. 따라서 I/O depth가 높을수록 throughput이 좋아지며 최대 2048 request를 동시에 지원할 수 있습니다.

운영 시 주의사항
동작보장 또는 요구사항
OverwriteFree block이 없으면 실패 가능
DiscardReference는 해제하지만 실제 공간 회수는 미보장
CrashFlushed write는 보호, unflushed write persistence 미보장
Parallelism높은 I/O depth에서 유리, 최대 2048 request

Thin provisioning과 shared physical block이 일반 block target과 다른 결과를 만듭니다.

Workload별 tuning

370-413

vdo device에는 option이 많아 workload를 정확히 알지 못하면 최적값을 고르기 어렵습니다. 대부분의 configuration option은 target start 때 정해야 하고 완전히 shutdown하지 않으면 바꿀 수 없으며 target이 active인 동안은 configuration을 변경할 수 없습니다. Production 배포 전에 simulated workload로 tuning하는 것이 이상적입니다.

가장 중요한 조정값은 block map cache size입니다. 임의 logical address request를 처리하려면 해당 mapping이 든 block map 부분을 load해야 하며 이 mapping을 cache합니다. Working set이 cache에 맞지 않으면 성능이 저하됩니다. 기본적으로 vdo는 한 번에 100GB logical space에 효율적으로 접근하도록 RAM에 128MB metadata cache를 할당합니다. 더 큰 working set에는 비례해서 늘려야 합니다.

Logical·physical thread count도 조정해야 합니다. Logical thread는 block map의 서로 겹치지 않는 section을 제어하므로 thread를 추가하면 parallelism과 throughput이 증가할 수 있습니다. Physical thread는 data block의 서로 겹치지 않는 section을 제어하므로 역시 throughput을 높일 수 있습니다. 그러나 thread가 지나치면 resource를 낭비하고 contention이 증가합니다.

Bio submission thread는 underlying storage로 I/O를 보내는 parallelism을 제어합니다. Thread가 적으면 성능을 위해 I/O request를 reorder할 기회가 많지만 각 request가 제출되기 전 더 오래 기다립니다.

Bio acknowledgment thread는 I/O request를 완료합니다. Bio callback 실행에 필요한 작업량을 vdo가 제어할 수 없으므로 전용 thread에서 수행합니다. 보통 하나면 충분하지만 bio callback이 CPU-heavy하면 추가 thread가 유용할 수 있습니다.

CPU thread는 hashing과 compression에 사용됩니다. Compression을 활성화한 workload에서는 thread를 늘리면 throughput이 높아질 수 있습니다.

Hash thread는 active request를 hash로 정렬하고 deduplicate 여부를 판단합니다. 가장 CPU-intensive한 작업은 4096-byte data block 비교입니다. 대부분의 경우 hash thread 하나면 충분합니다.

Tuning 우선순위
항목늘릴 때의 효과주의점
Block map cache더 큰 logical working set 수용RAM 증가, 100GB당 기본 128MB
Logical threadsBlock map parallelism 증가과도하면 contention
Physical threadsData block parallelism 증가Thread당 slab 필요
Bio threadsSubmission parallelism 증가적을수록 reorder 기회 증가
Ack threadsCPU-heavy callback 격리보통 1개 충분
CPU threadsHashing·compression throughput 증가CPU 사용 증가
Hash threadsDedup comparison parallelism대부분 1개 충분

먼저 working set cache를 맞춘 뒤 workload bottleneck에 따라 thread group을 조정합니다.