1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241
|
'\" t
.\" Title: chmem
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.20
.\" Date: 2026-02-18
.\" Manual: System Administration
.\" Source: util-linux 2.42-rc1
.\" Language: English
.\"
.TH "CHMEM" "8" "2026-02-18" "util\-linux 2.42\-rc1" "System Administration"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
.nh
.ad l
.de URL
\fI\\$2\fP <\\$1>\\$3
..
.als MTO URL
.if \n[.g] \{\
. mso www.tmac
. am URL
. ad l
. .
. am MTO
. ad l
. .
. LINKSTYLE blue R < >
.\}
.SH "NAME"
chmem \- configure memory
.SH "SYNOPSIS"
.sp
\fBchmem\fP [\fB\-h\fP] [\fB\-V\fP] [\fB\-v\fP] [\fB\-c\fP|\fB\-e\fP|\fB\-d\fP|\fB\-g\fP] [\fISIZE\fP|\fIRANGE\fP|\fB\-b\fP \fIBLOCKRANGE\fP] [\fB\-z\fP \fIZONE\fP] [\fB\-m\fP \fIMEMMAP\-ON\-MEMORY\fP]
.SH "DESCRIPTION"
.sp
The \fBchmem\fP command sets a particular size or range of memory online or offline.
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
Specify \fISIZE\fP as <size>[m|M|g|G]. With m or M, <size> specifies the memory size in MiB (1024 x 1024 bytes). With g or G, <size> specifies the memory size in GiB (1024 x 1024 x 1024 bytes). The default unit is MiB.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
Specify \fIRANGE\fP in the form 0x<start>\-0x<end> as shown in the output of the \fBlsmem\fP(1) command. <start> is the hexadecimal address of the first byte and <end> is the hexadecimal address of the last byte in the memory range.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
Specify \fIBLOCKRANGE\fP in the form <first>\-<last> or <block> as shown in the output of the \fBlsmem\fP(1) command. <first> is the number of the first memory block and <last> is the number of the last memory block in the memory range. Alternatively a single block can be specified. \fIBLOCKRANGE\fP requires the \fB\-\-blocks\fP option.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
Specify \fIZONE\fP as the name of a memory zone, as shown in the output of the \fBlsmem \-o +ZONES\fP command. The output shows one or more valid memory zones for each memory range. If multiple zones are shown, then the memory range currently belongs to the first zone. By default, \fBchmem\fP will set memory online to the zone Movable, if this is among the valid zones. This default can be changed by specifying the \fB\-\-zone\fP option with another valid zone. For memory ballooning, it is recommended to select the zone Movable for memory online and offline, if possible. Memory in this zone is much more likely to be able to be offlined again, but it cannot be used for arbitrary kernel allocations, only for migratable pages (e.g., anonymous and page cache pages). Use the \fB\-\-help\fP option to see all available zones.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
Specify \fIMEMMAP\-ON\-MEMORY\fP as 1 or 0. A value of 1 allocates hotplug metadata (such as the struct pages array) from the hotplug memory itself, enabling hot\-add operations even under memory pressure and without requiring additional system memory to do so. A value of 0 stores hotplugged memory metadata in regular system memory, which helps avoid issues related to fragmentation of continuous physical memory across memory blocks. The value can only be set when the memory block is in a deconfigured state, and \fB\-\-memmap\-on\-memory\fP is valid only with \fB\-\-configure\fP. If not specified, and if supported, \fBchmem\fP uses the default value shown in \fBlsmem\fP output.
.RE
.sp
The \fB\-\-enable\fP option configures the memory, if this is supported by the architecture. If configuring memory is not supported by the architecture, \fB\-\-enable\fP still brings the memory online.
.sp
The \fB\-\-disable\fP option brings the memory offline and performs an optional deconfigure step if this is supported by the architecture.
.sp
The \fB\-\-configure\fP option requests memory from the hypervisor without bringing it online, when supported by the architecture, allowing explicit control and use of \fB\-\-memmap\-on\-memory\fP.
.sp
The \fB\-\-deconfigure\fP option returns memory resources to the hypervisor if supported by the architecture.
.sp
\fISIZE\fP and \fIRANGE\fP must be aligned to the Linux memory block size, as shown in the output of the \fBlsmem\fP(1) command.
.sp
Setting memory online can fail for various reasons. On virtualized systems it can fail if the hypervisor does not have enough memory left, for example because memory was overcommitted. Setting memory offline can fail if Linux cannot free the memory. If only part of the requested memory can be set online or offline, a message tells you how much memory was set online or offline instead of the requested amount.
.sp
When setting memory online or when configuring memory, \fBchmem\fP starts with the lowest memory block numbers. When setting memory offline or deconfiguring memory, \fBchmem\fP starts with the highest memory block numbers.
.SH "ARCHITECTURE"
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
s390 architecture:
.RE
.sp
\fIMEMMAP\-ON\-MEMORY\fP: For memory blocks configured online at boot, the default value is 0 because they are added without memmap\-on\-memory support. Memory added dynamically at runtime uses the default value displayed in \fBlsmem\fP output.
.SH "OPTIONS"
.sp
\fB\-b\fP, \fB\-\-blocks\fP
.RS 4
Use a \fIBLOCKRANGE\fP parameter instead of \fIRANGE\fP or \fISIZE\fP for the \fB\-\-enable\fP and \fB\-\-disable\fP options.
.RE
.sp
\fB\-c\fP, \fB\-\-configure\fP
.RS 4
Set the specified \fIRANGE\fP, \fISIZE\fP, or \fIBLOCKRANGE\fP of memory to be configured.
.RE
.sp
\fB\-d\fP, \fB\-\-disable\fP
.RS 4
Set the specified \fIRANGE\fP, \fISIZE\fP, or \fIBLOCKRANGE\fP of memory offline.
.RE
.sp
\fB\-e\fP, \fB\-\-enable\fP
.RS 4
Set the specified \fIRANGE\fP, \fISIZE\fP, or \fIBLOCKRANGE\fP of memory online.
.RE
.sp
\fB\-g\fP, \fB\-\-deconfigure\fP
.RS 4
Set the specified \fIRANGE\fP, \fISIZE\fP, or \fIBLOCKRANGE\fP of memory to be deconfigured.
.RE
.sp
\fB\-m\fP, \fB\-\-memmap\-on\-memory\fP
.RS 4
Select memmap\-on\-memory for the specified \fIRANGE\fP, \fISIZE\fP, or \fIBLOCKRANGE\fP of memory. This option is valid only with \fB\-\-configure\fP.
.RE
.sp
\fB\-z\fP, \fB\-\-zone\fP
.RS 4
Select the memory \fIZONE\fP where to set the specified \fIRANGE\fP, \fISIZE\fP, or \fIBLOCKRANGE\fP of memory online or offline. By default, memory will be set online to the zone Movable, if possible.
.RE
.sp
\fB\-v\fP, \fB\-\-verbose\fP
.RS 4
Verbose mode. Causes \fBchmem\fP to print debugging messages about its progress.
.RE
.sp
\fB\-h\fP, \fB\-\-help\fP
.RS 4
Display help text and exit.
.RE
.sp
\fB\-V\fP, \fB\-\-version\fP
.RS 4
Display version and exit.
.RE
.SH "EXIT STATUS"
.sp
\fBchmem\fP has the following exit status values:
.sp
\fB0\fP
.RS 4
success
.RE
.sp
\fB1\fP
.RS 4
failure
.RE
.sp
\fB64\fP
.RS 4
partial success
.RE
.SH "EXAMPLES"
.sp
\fBchmem \-\-enable 1024\fP
.RS 4
This command requests 1024 MiB of memory to be set online.
.RE
.sp
\fBchmem \-e 2g\fP
.RS 4
This command requests 2 GB of memory to be brought online and, if supported by the architecture, configures the memory beforehand.
.RE
.sp
\fBchmem \-\-disable 0x00000000e4000000\-0x00000000f3ffffff\fP
.RS 4
This command takes the memory range from 0x00000000e4000000 to 0x00000000f3ffffff offline and deconfigures it if supported by the architecture.
.RE
.sp
\fBchmem \-b \-d 10\fP
.RS 4
This command takes memory block number 10 offline.
.RE
.sp
\fBchmem \-b \-c 10 \-m 1\fP
.RS 4
This command configures memory block 10 with \fIMEMMAP\-ON\-MEMORY\fP set. The block must be in a deconfigured state.
.RE
.sp
\fBchmem \-b \-c 10\fP
.RS 4
This command configures memory block 10 with the default \fIMEMMAP\-ON\-MEMORY\fP setting. The default value is displayed in \fBlsmem \-\-output\-all\fP. The block must be in a deconfigured state.
.RE
.sp
\fBchmem \-b \-g 10\fP
.RS 4
This command deconfigures memory block 10. The block must be offline.
.RE
.sp
\fBchmem \-d 5g\fP
.RS 4
This command takes 5 GB of memory offline and deconfigures it if supported by the architecture. Blocks that are already offline but still configured are skipped and must be explicitly deconfigured with \fB\-\-deconfigure\fP.
.RE
.SH "SEE ALSO"
.sp
\fBlsmem\fP(1)
.SH "REPORTING BUGS"
.sp
For bug reports, use the \c
.URL "https://github.com/util\-linux/util\-linux/issues" "issue tracker" "."
.SH "AVAILABILITY"
.sp
The \fBchmem\fP command is part of the util\-linux package which can be downloaded from \c
.URL "https://www.kernel.org/pub/linux/utils/util\-linux/" "Linux Kernel Archive" "."
|