man-pages/man8/chmem.8.html
2021-03-31 01:06:50 +01:00

181 lines
5.7 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of CHMEM</TITLE>
</HEAD><BODY>
<H1>CHMEM</H1>
Section: System Administration (8)<BR>Updated: October 2016<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
chmem - configure memory
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<B>chmem</B>
[<B>-h</B>] [<B>-V</B>] [<B>-v</B>] [<B>-e</B>|<B>-d</B>]
[<I>SIZE</I>|<I>RANGE</I>|<B>-b</B> <I>BLOCKRANGE</I>]
[-z ZONE]
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
The chmem command sets a particular size or range of memory online or offline.
<DL COMPACT>
<DT id="1">-<DD>
Specify <I>SIZE</I> as &lt;size&gt;[m|M|g|G]. With m or M, &lt;size&gt; specifies the memory
size in MiB (1024 x 1024 bytes). With g or G, &lt;size&gt; specifies the memory size
in GiB (1024 x 1024 x 1024 bytes). The default unit is MiB.
<DT id="2">-<DD>
Specify <I>RANGE</I> in the form 0x&lt;start&gt;-0x&lt;end&gt; as shown in the output of the
<B>lsmem</B> command. &lt;start&gt; is the hexadecimal address of the first byte and &lt;end&gt;
is the hexadecimal address of the last byte in the memory range.
<DT id="3">-<DD>
Specify <I>BLOCKRANGE</I> in the form &lt;first&gt;-&lt;last&gt; or &lt;block&gt; as shown in the
output of the <B>lsmem</B> command. &lt;first&gt; is the number of the first memory block
and &lt;last&gt; is the number of the last memory block in the memory
range. Alternatively a single block can be specified. <I>BLOCKRANGE</I> requires
the <B>--blocks</B> option.
<DT id="4">-<DD>
Specify <I>ZONE</I> as the name of a memory zone, as shown in the output of the
<B>lsmem -o +ZONES</B> 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 <B>--zone</B> 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 <B>--help</B> option to see all available zones.
</DL>
<P>
<I>SIZE</I> and <I>RANGE</I> must be aligned to the Linux memory block size, as
shown in the output of the <B>lsmem</B> command.
<P>
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.
<P>
When setting memory online <B>chmem</B> starts with the lowest memory block
numbers. When setting memory offline <B>chmem</B> starts with the highest memory
block numbers.
<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>
<DL COMPACT>
<DT id="5"><B>-b</B>, <B>--blocks</B>
<DD>
Use a <I>BLOCKRANGE</I> parameter instead of <I>RANGE</I> or <I>SIZE</I> for the
<B>--enable</B> and <B>--disable</B> options.
<DT id="6"><B>-d</B>, <B>--disable</B>
<DD>
Set the specified <I>RANGE</I>, <I>SIZE</I>, or <I>BLOCKRANGE</I> of memory offline.
<DT id="7"><B>-e</B>, <B>--enable</B>
<DD>
Set the specified <I>RANGE</I>, <I>SIZE</I>, or <I>BLOCKRANGE</I> of memory online.
<DT id="8"><B>-z</B>, <B>--zone</B>
<DD>
Select the memory <I>ZONE</I> where to set the specified <I>RANGE</I>, <I>SIZE</I>,
or <I>BLOCKRANGE</I> of memory online or offline. By default, memory will be set
online to the zone Movable, if possible.
<DT id="9"><B>-h</B>, <B>--help</B>
<DD>
Print a short help text, then exit.
<DT id="10"><B>-v</B>, <B>--verbose</B>
<DD>
Verbose mode. Causes <B>chmem</B> to print debugging messages about it's
progress.
<DT id="11"><B>-V</B>, <B>--version</B>
<DD>
Print the version number, then exit.
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>RETURN CODES</H2>
<B>chmem</B>
has the following return codes:
<DL COMPACT>
<DT id="12"><B>0</B>
<DD>
success
<DT id="13"><B>1</B>
<DD>
failure
<DT id="14"><B>64</B>
<DD>
partial success
</DL>
<A NAME="lbAG">&nbsp;</A>
<H2>EXAMPLES</H2>
<DL COMPACT>
<DT id="15"><B>chmem --enable 1024</B>
<DD>
This command requests 1024 MiB of memory to be set online.
<DT id="16"><B>chmem -e 2g</B>
<DD>
This command requests 2 GiB of memory to be set online.
<DT id="17"><B>chmem --disable 0x00000000e4000000-0x00000000f3ffffff</B>
<DD>
This command requests the memory range starting with 0x00000000e4000000
and ending with 0x00000000f3ffffff to be set offline.
<DT id="18"><B>chmem -b -d 10</B>
<DD>
This command requests the memory block number 10 to be set offline.
</DL>
<A NAME="lbAH">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?1+lsmem">lsmem</A></B>(1)
<A NAME="lbAI">&nbsp;</A>
<H2>AVAILABILITY</H2>
The <B>chmem</B> command is part of the util-linux package and is available from
Linux Kernel Archive
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="19"><A HREF="#lbAB">NAME</A><DD>
<DT id="20"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="21"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="22"><A HREF="#lbAE">OPTIONS</A><DD>
<DT id="23"><A HREF="#lbAF">RETURN CODES</A><DD>
<DT id="24"><A HREF="#lbAG">EXAMPLES</A><DD>
<DT id="25"><A HREF="#lbAH">SEE ALSO</A><DD>
<DT id="26"><A HREF="#lbAI">AVAILABILITY</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:06:11 GMT, March 31, 2021
</BODY>
</HTML>