1DAXCTL-RECONFIGURE() DAXCTL-RECONFIGURE()
2
3
4
6 daxctl-reconfigure-device - Reconfigure a dax device into a different
7 mode
8
10 daxctl reconfigure-device <dax0.0> [<dax1.0>...<daxY.Z>] [<options>]
11
13 • Reconfigure dax0.0 to system-ram mode, don’t online the memory
14
15
16 .ft C
17 # daxctl reconfigure-device --mode=system-ram --no-online dax0.0
18 [
19 {
20 "chardev":"dax0.0",
21 "size":16777216000,
22 "target_node":2,
23 "mode":"system-ram"
24 }
25 ]
26 .ft
27
28
29 • Reconfigure dax0.0 to devdax mode, attempt to offline the memory
30
31
32 .ft C
33 # daxctl reconfigure-device --human --mode=devdax --force dax0.0
34 {
35 "chardev":"dax0.0",
36 "size":"15.63 GiB (16.78 GB)",
37 "target_node":2,
38 "mode":"devdax"
39 }
40 .ft
41
42
43 • Reconfigure all dax devices on region0 to system-ram mode
44
45
46 .ft C
47 # daxctl reconfigure-device --mode=system-ram --region=0 all
48 [
49 {
50 "chardev":"dax0.0",
51 "size":16777216000,
52 "target_node":2,
53 "mode":"system-ram"
54 },
55 {
56 "chardev":"dax0.1",
57 "size":16777216000,
58 "target_node":3,
59 "mode":"system-ram"
60 }
61 ]
62 .ft
63
64
65 • Run a process called some-service using numactl to restrict its cpu
66 nodes to 0 and 1, and memory allocations to node 2 (determined
67 using daxctl_dev_get_target_node() or daxctl list)
68
69
70 .ft C
71 # daxctl reconfigure-device --mode=system-ram dax0.0
72 [
73 {
74 "chardev":"dax0.0",
75 "size":16777216000,
76 "target_node":2,
77 "mode":"system-ram"
78 }
79 ]
80
81 # numactl --cpunodebind=0-1 --membind=2 -- some-service --opt1 --opt2
82 .ft
83
84
85 • Change the size of a dax device
86
87
88 .ft C
89 # daxctl reconfigure-device dax0.1 -s 16G
90 reconfigured 1 device
91 # daxctl reconfigure-device dax0.1 -s 0
92 reconfigured 1 device
93 .ft
94
95
97 Reconfigure the operational mode of a dax device. This can be used to
98 convert a regular devdax mode device to the system-ram mode which
99 arranges for the dax range to be hot-plugged into the system as regular
100 memory.
101
102 Note
103 This is a destructive operation. Any data on the dax device will be
104 lost.
105
106 Note
107 Device reconfiguration depends on the dax-bus device model. See
108 daxctl-migrate-device-model(1) for more information. If dax-class
109 is in use (via the dax_pmem_compat driver), the reconfiguration
110 will fail with an error such as the following:
111
112
113 .ft C
114 # daxctl reconfigure-device --mode=system-ram --region=0 all
115 libdaxctl: daxctl_dev_disable: dax3.0: error: device model is dax-class
116 dax3.0: disable failed: Operation not supported
117 error reconfiguring devices: Operation not supported
118 reconfigured 0 devices
119 .ft
120
121
122 daxctl-reconfigure-device nominally expects that it will online new
123 memory blocks as movable, so that kernel data doesn’t make it into this
124 memory. However, there are other potential agents that may be
125 configured to automatically online new hot-plugged memory as it
126 appears. Most notably, these are the
127 /sys/devices/system/memory/auto_online_blocks configuration, or system
128 udev rules. If such an agent races to online memory sections, daxctl
129 checks if the blocks were onlined as movable memory. If this was not
130 the case, and the memory blocks are found to be in a different zone,
131 then a warning is displayed. If it is desired that a different agent
132 control the onlining of memory blocks, and the associated memory zone,
133 then it is recommended to use the --no-online option described below.
134 This will abridge the device reconfiguration operation to just
135 hotplugging the memory, and refrain from then onlining it.
136
138 -r, --region=
139 Restrict the operation to devices belonging to the specified
140 region(s). A device-dax region is a contiguous range of memory that
141 hosts one or more /dev/daxX.Y devices, where X is the region id and
142 Y is the device instance id.
143
144 -s, --size=
145 For regions that support dax device creation, change the device
146 size in bytes. This option supports the suffixes "k" or "K" for
147 KiB, "m" or "M" for MiB, "g" or "G" for GiB and "t" or "T" for TiB.
148
149 The size must be a multiple of the region alignment.
150
151 This option is mutually exclusive with -m or --mode.
152
153 -a, --align
154 Applications that want to establish dax memory mappings with page
155 table entries greater than system base page size (4K on x86) need a
156 device that is sufficiently aligned. This defaults to 2M. Note that
157 "devdax" mode enforces all mappings to be aligned to this value,
158 i.e. it fails unaligned mapping attempts.
159
160 This option is mutually exclusive with -m or --mode.
161
162 -m, --mode=
163 Specify the mode to which the dax device(s) should be reconfigured.
164
165 • "system-ram": hotplug the device into system memory.
166
167 • "devdax": switch to the normal "device dax" mode. This requires
168 the kernel to support hot-unplugging kmem based memory. If this
169 is not available, a reboot is the only way to switch back to
170 devdax mode.
171
172 -N, --no-online
173 By default, memory sections provided by system-ram devices will be
174 brought online automatically and immediately with the
175 online_movable policy. Use this option to disable the automatic
176 onlining behavior.
177
178 --no-movable
179 --movable is the default. This can be overridden to online new
180 memory such that it is not movable. This allows any allocation to
181 potentially be served from this memory. This may preclude
182 subsequent removal. With the --movable behavior (which is default),
183 kernel allocations will not consider this memory, and it will be
184 reserved for application use.
185
186 -f, --force
187 When converting from "system-ram" mode to "devdax", it is expected
188 that all the memory sections are first made offline. By default,
189 daxctl won’t touch online memory. However with this option, attempt
190 to offline the memory on the NUMA node associated with the dax
191 device before converting it back to "devdax" mode.
192
193 -u, --human
194 By default the command will output machine-friendly raw-integer
195 data. Instead, with this flag, numbers representing storage size
196 will be formatted as human readable strings with units, other
197 fields are converted to hexadecimal strings.
198
199 -v, --verbose
200 Emit more debug messages
201
203 Copyright © 2016 - 2020, Intel Corporation. License GPLv2: GNU GPL
204 version 2 http://gnu.org/licenses/gpl.html. This is free software: you
205 are free to change and redistribute it. There is NO WARRANTY, to the
206 extent permitted by law.
207
209 daxctl-list(1),daxctl-migrate-device-model[1]
210
211
212
213 DAXCTL-RECONFIGURE()