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

Linux 6.18.37 · Administration / Device Mapper

Device-Mapper Logging

RAID·mirror dirty region을 추적하는 disk, core, userspace log 구현과 cluster-coherent logging 구조입니다.

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

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

1. 요약·해설

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

Dirty region 모델

dm-log.rst:1-18

Write와 crash 중 불일치 region을 추적하는 generic logging interface를 설명합니다.

Disk와 core 구현

dm-log.rst:19-39

구현 source path와 상태 지속성·성능 tradeoff를 비교합니다.

Userspace와 cluster log

dm-log.rst:40-57

Connector 기반 daemon 통신과 clustered-disk·clustered-core 용도를 정리합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 =====================
2 Device-Mapper Logging
3 =====================
4 The device-mapper logging code is used by some of the device-mapper
5 RAID targets to track regions of the disk that are not consistent.
6 A region (or portion of the address space) of the disk may be
7 inconsistent because a RAID stripe is currently being operated on or
8 a machine died while the region was being altered. In the case of
9 mirrors, a region would be considered dirty/inconsistent while you
10 are writing to it because the writes need to be replicated for all
11 the legs of the mirror and may not reach the legs at the same time.
12 Once all writes are complete, the region is considered clean again.
13
14 There is a generic logging interface that the device-mapper RAID
15 implementations use to perform logging operations (see
16 dm_dirty_log_type in include/linux/dm-dirty-log.h). Various different
17 logging implementations are available and provide different
18 capabilities. The list includes:
19
20 ============== ==============================================================
21 Type Files
22 ============== ==============================================================
23 disk drivers/md/dm-log.c
24 core drivers/md/dm-log.c
25 userspace drivers/md/dm-log-userspace* include/linux/dm-log-userspace.h
26 ============== ==============================================================
27
28 The "disk" log type
29 -------------------
30 This log implementation commits the log state to disk. This way, the
31 logging state survives reboots/crashes.
32
33 The "core" log type
34 -------------------
35 This log implementation keeps the log state in memory. The log state
36 will not survive a reboot or crash, but there may be a small boost in
37 performance. This method can also be used if no storage device is
38 available for storing log state.
39
40 The "userspace" log type
41 ------------------------
42 This log type simply provides a way to export the log API to userspace,
43 so log implementations can be done there. This is done by forwarding most
44 logging requests to userspace, where a daemon receives and processes the
45 request.
46
47 The structure used for communication between kernel and userspace are
48 located in include/linux/dm-log-userspace.h. Due to the frequency,
49 diversity, and 2-way communication nature of the exchanges between
50 kernel and userspace, 'connector' is used as the interface for
51 communication.
52
53 There are currently two userspace log implementations that leverage this
54 framework - "clustered-disk" and "clustered-core". These implementations
55 provide a cluster-coherent log for shared-storage. Device-mapper mirroring
56 can be used in a shared-storage environment when the cluster log implementations
57 are employed.
58

3. 한국어 전문 번역

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

RAID 불일치 region 추적과 generic log API

1-18

Device-mapper logging 코드는 일부 device-mapper RAID target이 일관되지 않은 disk region을 추적하는 데 사용합니다.

RAID stripe를 현재 변경 중이거나 region 변경 도중 시스템이 죽으면 disk address space의 해당 region이 inconsistent 상태가 될 수 있습니다. Mirror에서는 write를 모든 mirror leg에 복제해야 하고 각 leg에 동시에 도달하지 않을 수 있으므로, write 중인 region을 dirty 또는 inconsistent로 봅니다. 모든 write가 끝나면 다시 clean 상태가 됩니다.

Mirror region 상태 변화
Clean regionWrite 시작Dirty/inconsistent 표시모든 mirror leg에 복제모든 write 완료Clean region
Region 변경 중 crashInconsistent 상태 보존복구·동기화 필요

복제 write가 모든 leg에 도달할 때까지 region을 dirty로 유지합니다.

Device-mapper RAID 구현은 logging 작업을 수행하는 generic interface를 사용합니다. 인터페이스 정의는 `include/linux/dm-dirty-log.h`의 `dm_dirty_log_type`을 참고할 수 있습니다. 서로 다른 기능을 제공하는 여러 logging 구현이 준비되어 있습니다.

Logging 구현과 source file

19-27
Device-mapper log 구현
TypeFiles
`disk``drivers/md/dm-log.c`
`core``drivers/md/dm-log.c`
`userspace``drivers/md/dm-log-userspace*`, `include/linux/dm-log-userspace.h`

Kernel 내장형과 userspace 전달형의 구현 위치를 보존합니다.

==============	==============================================================
Type		Files
==============	==============================================================
disk		drivers/md/dm-log.c
core		drivers/md/dm-log.c
userspace	drivers/md/dm-log-userspace* include/linux/dm-log-userspace.h
==============	==============================================================

disk와 core log의 지속성 tradeoff

28-39

`disk` log 구현은 log state를 disk에 commit합니다. 따라서 reboot나 crash 이후에도 logging 상태가 남습니다.

`core` log 구현은 log state를 memory에 보관합니다. Reboot나 crash를 견디지는 못하지만 성능이 조금 향상될 수 있으며, log state를 저장할 storage device가 없을 때도 사용할 수 있습니다.

disk와 core log 비교
Type상태 위치Reboot/crash 후적합한 상황
`disk`Disk상태 유지복구를 위해 dirty state 지속성이 필요함
`core`Memory상태 소실작은 성능 향상 또는 log storage가 없음

상태 지속성, 성능과 필요한 자원을 비교합니다.

Userspace log와 cluster-coherent 구현

40-57

`userspace` log type은 log API를 userspace로 export해 그곳에서 구현할 수 있게 합니다. 대부분의 logging request를 userspace로 전달하고 daemon이 이를 받아 처리합니다.

Kernel과 userspace 사이의 통신 구조체는 `include/linux/dm-log-userspace.h`에 있습니다. 교환 빈도가 높고, 요청 종류가 다양하며, 양방향 통신이 필요하므로 통신 인터페이스로 `connector`를 사용합니다.

Userspace logging 요청 경로
Device-mapper RAID targetUserspace log API`connector`Userspace daemonLog 구현 처리결과 회신

Kernel log API 호출을 daemon으로 전달하고 결과를 양방향으로 회신합니다.

현재 이 framework를 사용하는 userspace log 구현은 `clustered-disk`와 `clustered-core` 두 가지입니다. 이들은 shared storage를 위한 cluster-coherent log를 제공하며, 이를 사용하면 shared-storage 환경에서 device-mapper mirroring을 사용할 수 있습니다.

Cluster userspace log
구현상태 성격용도
`clustered-disk`Disk 기반 cluster-coherent log지속 가능한 shared-storage mirror log
`clustered-core`Memory 기반 cluster-coherent logShared-storage mirror의 cluster 상태 조정

공유 storage 환경에서 여러 node가 일관된 dirty-region 상태를 공유합니다.