summaryrefslogtreecommitdiffstats
path: root/sys-utils/chmem.8
diff options
context:
space:
mode:
authorGerald Schaefer2017-09-27 19:44:44 +0200
committerKarel Zak2017-10-20 12:37:04 +0200
commit60a7e9e94e49215b1e6ac6e33b69c3bd0a426b5e (patch)
tree58c8429d9e8a24c4a1b92d72af1589f4c8fcc478 /sys-utils/chmem.8
parentlibmount: use eacess() rather than open() to check mtab/utab (diff)
downloadkernel-qcow2-util-linux-60a7e9e94e49215b1e6ac6e33b69c3bd0a426b5e.tar.gz
kernel-qcow2-util-linux-60a7e9e94e49215b1e6ac6e33b69c3bd0a426b5e.tar.xz
kernel-qcow2-util-linux-60a7e9e94e49215b1e6ac6e33b69c3bd0a426b5e.zip
lsmem/chmem: add memory zone awareness
With this patch, valid memory zones can be shown with lsmem, and chmem can set memory online/offline in a specific memory zone, if allowed by the kernel. The valid memory zones are read from the "valid_zones" sysfs attribute, and setting memory online to a specific zone is done by echoing "online_kernel" or "online_movable" to the "state" sysfs attribute, in addition to the previous "online". This patch also changes the default behavior of chmem, when setting memory online without specifying a memory zone. If valid, memory will be set online to the zone Movable. This zone is preferable for memory hotplug, as it makes memory offline much more likely to succeed. Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Diffstat (limited to 'sys-utils/chmem.8')
-rw-r--r--sys-utils/chmem.819
1 files changed, 19 insertions, 0 deletions
diff --git a/sys-utils/chmem.8 b/sys-utils/chmem.8
index a116bc9e7..dae7413d4 100644
--- a/sys-utils/chmem.8
+++ b/sys-utils/chmem.8
@@ -5,6 +5,7 @@ chmem \- configure memory
.B chmem
.RB [ \-h "] [" \-V "] [" \-v "] [" \-e | \-d "]"
[\fISIZE\fP|\fIRANGE\fP|\fB\-b\fP \fIBLOCKRANGE\fP]
+[-z ZONE]
.SH DESCRIPTION
The chmem command sets a particular size or range of memory online or offline.
.
@@ -25,6 +26,19 @@ 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.
.
+.IP "\(hy" 2
+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, chmem 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\fR option to see all available zones.
+.
.PP
\fISIZE\fP and \fIRANGE\fP must be aligned to the Linux memory block size, as
shown in the output of the \fBlsmem\fP command.
@@ -51,6 +65,11 @@ Set the specified \fIRANGE\fP, \fISIZE\fP, or \fIBLOCKRANGE\fP of memory offline
.BR \-e ", " \-\-enable
Set the specified \fIRANGE\fP, \fISIZE\fP, or \fIBLOCKRANGE\fP of memory online.
.TP
+.BR \-z ", " \-\-zone
+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.
+.TP
.BR \-h ", " \-\-help
Print a short help text, then exit.
.TP