← Documents Documentation/ABI/testing/sysfs-devices-memory GitHub 원문 ↗

Linux 6.18.37 · ABI / testing

Memory block hotplug sysfs ABI

Kernel memory-block snapshot, legacy removable·physical metadata, online/offline zone selection, NUMA links와 crash-kernel hotplug update를 설명합니다.

Source pathDocumentation/ABI/testing/sysfs-devices-memory
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

Memory-block tree and legacy metadata

sysfs-devices-memory:1-41

Memory tree는 hot-add/remove에 따라 동적으로 바뀌며 removable, s390x storage increment와 hexadecimal section ID 같은 legacy metadata를 제공합니다.

Online state and valid zones

sysfs-devices-memory:42-88

Root는 memory block을 online/offline하고 online_movable 또는 online_kernel로 target zone을 선택하며 valid_zones에서 current/default zone과 offline 가능성을 확인합니다.

Memory-section and NUMA-node links

sysfs-devices-memory:89-113

CONFIG_NUMA에서는 memory section에서 node로, node에서 memory section으로 향하는 reciprocal symbolic link가 생성됩니다.

Crash-kernel hotplug updates

sysfs-devices-memory:114-120

crash_hotplug는 memory hotplug·online event에서 kernel이 kexec segment를 갱신해 kdump kernel reload를 피할 수 있는지 표시합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 What: /sys/devices/system/memory
2 Date: June 2008
3 Contact: Badari Pulavarty <[email protected]>
4 Description:
5 The /sys/devices/system/memory contains a snapshot of the
6 internal state of the kernel memory blocks. Files could be
7 added or removed dynamically to represent hot-add/remove
8 operations.
9 Users: hotplug memory add/remove tools
10 http://www.ibm.com/developerworks/wikis/display/LinuxP/powerpc-utils
11
12 What: /sys/devices/system/memory/memoryX/removable
13 Date: June 2008
14 Contact: Badari Pulavarty <[email protected]>
15 Description:
16 The file /sys/devices/system/memory/memoryX/removable is a
17 legacy interface used to indicated whether a memory block is
18 likely to be offlineable or not. Newer kernel versions return
19 "1" if and only if the kernel supports memory offlining.
20 Users: hotplug memory remove tools
21 http://www.ibm.com/developerworks/wikis/display/LinuxP/powerpc-utils
22 lsmem/chmem part of util-linux
23
24 What: /sys/devices/system/memory/memoryX/phys_device
25 Date: September 2008
26 Contact: Badari Pulavarty <[email protected]>
27 Description:
28 The file /sys/devices/system/memory/memoryX/phys_device
29 is read-only; it is a legacy interface only ever used on s390x
30 to expose the covered storage increment.
31 Users: Legacy s390-tools lsmem/chmem
32
33 What: /sys/devices/system/memory/memoryX/phys_index
34 Date: September 2008
35 Contact: Badari Pulavarty <[email protected]>
36 Description:
37 The file /sys/devices/system/memory/memoryX/phys_index
38 is read-only and contains the section ID in hexadecimal
39 which is equivalent to decimal X contained in the
40 memory section directory name.
41
42 What: /sys/devices/system/memory/memoryX/state
43 Date: September 2008
44 Contact: Badari Pulavarty <[email protected]>
45 Description:
46 The file /sys/devices/system/memory/memoryX/state
47 is read-write. When read, it returns the online/offline
48 state of the memory block. When written, root can toggle
49 the online/offline state of a memory block using the following
50 commands::
51
52 # echo online > /sys/devices/system/memory/memoryX/state
53 # echo offline > /sys/devices/system/memory/memoryX/state
54
55 On newer kernel versions, advanced states can be specified
56 when onlining to select a target zone: "online_movable"
57 selects the movable zone. "online_kernel" selects the
58 applicable kernel zone (DMA, DMA32, or Normal). However,
59 after successfully setting one of the advanced states,
60 reading the file will return "online"; the zone information
61 can be obtained via "valid_zones" instead.
62
63 While onlining is unlikely to fail, there are no guarantees
64 that offlining will succeed. Offlining is more likely to
65 succeed if "valid_zones" indicates "Movable".
66 Users: hotplug memory remove tools
67 http://www.ibm.com/developerworks/wikis/display/LinuxP/powerpc-utils
68
69
70 What: /sys/devices/system/memory/memoryX/valid_zones
71 Date: July 2014
72 Contact: Zhang Zhen <[email protected]>
73 Description:
74 The file /sys/devices/system/memory/memoryX/valid_zones is
75 read-only.
76
77 For online memory blocks, it returns in which zone memory
78 provided by a memory block is managed. If multiple zones
79 apply (not applicable for hotplugged memory), "None" is returned
80 and the memory block cannot be offlined.
81
82 For offline memory blocks, it returns by which zone memory
83 provided by a memory block can be managed when onlining.
84 The first returned zone ("default") will be used when setting
85 the state of an offline memory block to "online". Only one of
86 the kernel zones (DMA, DMA32, Normal) is applicable for a single
87 memory block.
88
89 What: /sys/devices/system/memoryX/nodeY
90 Date: October 2009
91 Contact: Linux Memory Management list <[email protected]>
92 Description:
93 When CONFIG_NUMA is enabled, a symbolic link that
94 points to the corresponding NUMA node directory.
95
96 For example, the following symbolic link is created for
97 memory section 9 on node0:
98
99 /sys/devices/system/memory/memory9/node0 -> ../../node/node0
100
101
102 What: /sys/devices/system/node/nodeX/memoryY
103 Date: September 2008
104 Contact: Gary Hade <[email protected]>
105 Description:
106 When CONFIG_NUMA is enabled
107 /sys/devices/system/node/nodeX/memoryY is a symbolic link that
108 points to the corresponding /sys/devices/system/memory/memoryY
109 memory section directory. For example, the following symbolic
110 link is created for memory section 9 on node0.
111
112 /sys/devices/system/node/node0/memory9 -> ../../memory/memory9
113
114 What: /sys/devices/system/memory/crash_hotplug
115 Date: Aug 2023
116 Contact: Linux kernel mailing list <[email protected]>
117 Description:
118 (RO) indicates whether or not the kernel updates relevant kexec
119 segments on memory hot un/plug and/or on/offline events, avoiding the
120 need to reload kdump kernel.
121

3. 한국어 전문 번역

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

Dynamic memory-block snapshot

1-11
항목한국어 전문 번역
What/sys/devices/system/memory
Date2008년 6월
ContactBadari Pulavarty <[email protected]>
Description/sys/devices/system/memory는 kernel memory block internal state의 snapshot을 담습니다. Hot-add/remove operation을 나타내기 위해 file이 동적으로 추가·제거될 수 있습니다.
UsersHotplug memory add/remove tools; http://www.ibm.com/developerworks/wikis/display/LinuxP/powerpc-utils

Legacy memory-block removable indication

12-23
항목한국어 전문 번역
What/sys/devices/system/memory/memoryX/removable
Date2008년 6월
ContactBadari Pulavarty <[email protected]>
DescriptionMemory block을 offline할 가능성이 있는지 나타내는 legacy interface입니다. Newer kernel version은 kernel이 memory offlining을 지원할 때만 1을 반환합니다.
UsersHotplug memory remove tools; powerpc-utils; util-linux의 lsmem/chmem

Legacy s390x storage increment

24-32
항목한국어 전문 번역
What/sys/devices/system/memory/memoryX/phys_device
Date2008년 9월
ContactBadari Pulavarty <[email protected]>
DescriptionRead-only legacy interface이며 s390x에서만 covered storage increment를 expose하는 데 사용되었습니다.
UsersLegacy s390-tools lsmem/chmem

Hexadecimal memory-section ID

33-41
항목한국어 전문 번역
What/sys/devices/system/memory/memoryX/phys_index
Date2008년 9월
ContactBadari Pulavarty <[email protected]>
DescriptionRead-only이며 section ID를 hexadecimal로 담습니다. 이 값은 memory section directory name의 decimal X와 같습니다.
Memory-block identity attributes
Attribute역할
memoryXHot-add/remove에 따라 생성·제거되는 block
removableKernel memory-offlining support의 legacy indication
phys_devices390x covered storage increment legacy value
phys_indexDirectory X와 같은 section ID의 hexadecimal form

Dynamic block directory와 세 legacy/identity field의 역할입니다.

Online and offline memory-block state

42-69
항목한국어 전문 번역
What/sys/devices/system/memory/memoryX/state
Date2008년 9월
ContactBadari Pulavarty <[email protected]>
DescriptionRead/write file입니다. Read하면 memory block의 online/offline state를 반환합니다. Root는 online 또는 offline command를 write하여 state를 toggle할 수 있습니다. Newer kernel에서는 onlining할 때 target zone을 선택하는 advanced state도 지정할 수 있습니다. online_movable은 Movable zone을, online_kernel은 적용 가능한 kernel zone(DMA, DMA32 또는 Normal)을 선택합니다. Advanced state를 성공적으로 set한 뒤 read하면 "online"을 반환하며 zone 정보는 valid_zones에서 얻습니다. Onlining은 fail할 가능성이 낮지만 offlining 성공은 보장되지 않습니다. valid_zones가 "Movable"을 나타내면 offlining 성공 가능성이 더 높습니다.
UsersHotplug memory remove tools; powerpc-utils
# echo online > /sys/devices/system/memory/memoryX/state
# echo offline > /sys/devices/system/memory/memoryX/state

Current or selectable memory zones

70-88
항목한국어 전문 번역
What/sys/devices/system/memory/memoryX/valid_zones
Date2014년 7월
ContactZhang Zhen <[email protected]>
DescriptionRead-only file입니다. Online memory block에서는 block이 제공하는 memory를 어느 zone에서 관리하는지 반환합니다. 여러 zone이 적용되면(hotplugged memory에는 해당하지 않음) "None"을 반환하며 memory block을 offline할 수 없습니다. Offline memory block에서는 onlining할 때 어느 zone에서 관리할 수 있는지 반환합니다. 첫 번째 returned zone인 "default"는 offline block state를 "online"으로 설정할 때 사용됩니다. 한 memory block에는 kernel zone DMA, DMA32, Normal 중 하나만 적용됩니다.
Memory state write commands
Write value결과
onlinevalid_zones의 첫 default zone으로 online
online_movableMovable zone을 target으로 online
online_kernelApplicable DMA/DMA32/Normal zone으로 online
offlineOffline 시도, 성공 보장 없음

Requested state와 zone-selection semantics입니다.

Memory block online/offline lifecycle
Offline memoryX의 valid_zones readonline / online_movable / online_kernel 선택state write 후 read는 online 반환Current zone은 valid_zones에서 확인Movable이면 later offline 성공 가능성이 더 높음

valid_zones를 보고 target 또는 offlining 가능성을 판단합니다.

Crash-kernel hotplug segment updates

114-120
항목한국어 전문 번역
What/sys/devices/system/memory/crash_hotplug
Date2023년 8월
ContactLinux kernel mailing list <[email protected]>
Description(RO) Memory hot un/plug 및/또는 on/offline event에서 kernel이 관련 kexec segment를 update하여 kdump kernel을 reload할 필요를 없애는지 나타냅니다.
Crash-kernel memory hotplug handling
Memory hot-add/remove 또는 online/offlinecrash_hotplug capability 확인Kernel이 relevant kexec segments updatekdump kernel reload 회피

Supported kernel은 memory topology change를 kexec segment에 반영합니다.