]> git.ipfire.org Git - thirdparty/util-linux.git/blob - sys-utils/chmem.8
Merge branch 'getrandom' of git://github.com/kerolasa/lelux-utiliteetit
[thirdparty/util-linux.git] / sys-utils / chmem.8
1 .TH CHMEM 8 "October 2016" "util-linux" "System Administration"
2 .SH NAME
3 chmem \- configure memory
4 .SH SYNOPSIS
5 .B chmem
6 .RB [ \-h "] [" \-V "] [" \-v "] [" \-e | \-d "]"
7 [\fISIZE\fP|\fIRANGE\fP|\fB\-b\fP \fIBLOCKRANGE\fP]
8 .SH DESCRIPTION
9 The chmem command sets a particular size or range of memory online or offline.
10 .
11 .IP "\(hy" 2
12 Specify \fISIZE\fP as <size>[m|M|g|G]. With m or M, <size> specifies the memory
13 size in MiB (1024 x 1024 bytes). With g or G, <size> specifies the memory size
14 in GiB (1024 x 1024 x 1024 bytes). The default unit is MiB.
15 .
16 .IP "\(hy" 2
17 Specify \fIRANGE\fP in the form 0x<start>-0x<end> as shown in the output of the
18 \fBlsmem\fP command. <start> is the hexadecimal address of the first byte and <end>
19 is the hexadecimal address of the last byte in the memory range.
20 .
21 .IP "\(hy" 2
22 Specify \fIBLOCKRANGE\fP in the form <first>-<last> or <block> as shown in the
23 output of the \fBlsmem\fP command. <first> is the number of the first memory block
24 and <last> is the number of the last memory block in the memory
25 range. Alternatively a single block can be specified. \fIBLOCKRANGE\fP requires
26 the \fB--blocks\fP option.
27 .
28 .PP
29 \fISIZE\fP and \fIRANGE\fP must be aligned to the Linux memory block size, as
30 shown in the output of the \fBlsmem\fP command.
31
32 Setting memory online can fail for various reasons. On virtualized systems it
33 can fail if the hypervisor does not have enough memory left, for example
34 because memory was overcommitted. Setting memory offline can fail if Linux
35 cannot free the memory. If only part of the requested memory can be set online
36 or offline, a message tells you how much memory was set online or offline
37 instead of the requested amount.
38
39 When setting memory online \fBchmem\fP starts with the lowest memory block
40 numbers. When setting memory offline \fBchmem\fP starts with the highest memory
41 block numbers.
42 .SH OPTIONS
43 .TP
44 .BR \-b ", " \-\-blocks
45 Use a \fIBLOCKRANGE\fP parameter instead of \fIRANGE\fP or \fISIZE\fP for the
46 \fB--enable\fP and \fB--disable\fP options.
47 .TP
48 .BR \-d ", " \-\-disable
49 Set the specified \fIRANGE\fP, \fISIZE\fP, or \fIBLOCKRANGE\fP of memory offline.
50 .TP
51 .BR \-e ", " \-\-enable
52 Set the specified \fIRANGE\fP, \fISIZE\fP, or \fIBLOCKRANGE\fP of memory online.
53 .TP
54 .BR \-h ", " \-\-help
55 Print a short help text, then exit.
56 .TP
57 .BR \-v ", " \-\-verbose
58 Verbose mode. Causes \fBchmem\fP to print debugging messages about it's
59 progress.
60 .TP
61 .BR \-V ", " \-\-version
62 Print the version number, then exit.
63 .SH RETURN CODES
64 .B chmem
65 has the following return codes:
66 .TP
67 .BR 0
68 success
69 .TP
70 .BR 1
71 failure
72 .TP
73 .BR 64
74 partial success
75 .SH EXAMPLES
76 .TP
77 .B chmem --enable 1024
78 This command requests 1024 MiB of memory to be set online.
79 .TP
80 .B chmem -e 2g
81 This command requests 2 GiB of memory to be set online.
82 .TP
83 .B chmem --disable 0x00000000e4000000-0x00000000f3ffffff
84 This command requests the memory range starting with 0x00000000e4000000
85 and ending with 0x00000000f3ffffff to be set offline.
86 .TP
87 .B chmem -b -d 10
88 This command requests the memory block number 10 to be set offline.
89 .SH SEE ALSO
90 .BR lsmem (1)
91 .SH AVAILABILITY
92 The \fBchmem\fP command is part of the util-linux package and is available from
93 .UR https://\:www.kernel.org\:/pub\:/linux\:/utils\:/util-linux/
94 Linux Kernel Archive
95 .UE .