'\" t .\" Title: daxctl-reconfigure-device .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.10 .\" Date: 2020-12-22 .\" Manual: daxctl Manual .\" Source: daxctl .\" Language: English .\" .TH "DAXCTL\-RECONFIGURE\-DEVICE" "1" "2020-12-22" "daxctl" "daxctl Manual" .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" daxctl\-reconfigure\-device \- Reconfigure a dax device into a different mode .SH "SYNOPSIS" .sp .sp .nf \fIdaxctl reconfigure\-device\fP [...] [] .fi .br .SH "EXAMPLES" .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} Reconfigure dax0.0 to system\-ram mode, don\(cqt online the memory .RE .sp .if n .RS 4 .nf # daxctl reconfigure\-device \-\-mode=system\-ram \-\-no\-online dax0.0 [ { "chardev":"dax0.0", "size":16777216000, "target_node":2, "mode":"system\-ram" } ] .fi .if n .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} Reconfigure dax0.0 to devdax mode, attempt to offline the memory .RE .sp .if n .RS 4 .nf # daxctl reconfigure\-device \-\-human \-\-mode=devdax \-\-force dax0.0 { "chardev":"dax0.0", "size":"15.63 GiB (16.78 GB)", "target_node":2, "mode":"devdax" } .fi .if n .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} Reconfigure all dax devices on region0 to system\-ram mode .RE .sp .if n .RS 4 .nf # daxctl reconfigure\-device \-\-mode=system\-ram \-\-region=0 all [ { "chardev":"dax0.0", "size":16777216000, "target_node":2, "mode":"system\-ram" }, { "chardev":"dax0.1", "size":16777216000, "target_node":3, "mode":"system\-ram" } ] .fi .if n .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} Run a process called \fIsome\-service\fP using numactl to restrict its cpu nodes to \fI0\fP and \fI1\fP, and memory allocations to node 2 (determined using daxctl_dev_get_target_node() or \fIdaxctl list\fP) .RE .sp .if n .RS 4 .nf # daxctl reconfigure\-device \-\-mode=system\-ram dax0.0 [ { "chardev":"dax0.0", "size":16777216000, "target_node":2, "mode":"system\-ram" } ] # numactl \-\-cpunodebind=0\-1 \-\-membind=2 \-\- some\-service \-\-opt1 \-\-opt2 .fi .if n .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} Change the size of a dax device .RE .sp .if n .RS 4 .nf # daxctl reconfigure\-device dax0.1 \-s 16G reconfigured 1 device # daxctl reconfigure\-device dax0.1 \-s 0 reconfigured 1 device .fi .if n .RE .SH "DESCRIPTION" .sp Reconfigure the operational mode of a dax device. This can be used to convert a regular \fIdevdax\fP mode device to the \fIsystem\-ram\fP mode which arranges for the dax range to be hot\-plugged into the system as regular memory. .if n .sp .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 .B Note .ps -1 .br .sp This is a destructive operation. Any data on the dax device \fBwill\fP be lost. .sp .5v .RE .if n .sp .RS 4 .it 1 an-trap .nr an-no-space-flag 1 .nr an-break-flag 1 .br .ps +1 .B Note .ps -1 .br .sp Device reconfiguration depends on the dax\-bus device model. See daxctl\-migrate\-device\-model(1) for more information. If dax\-class is in use (via the dax_pmem_compat driver), the reconfiguration will fail with an error such as the following: .sp .5v .RE .sp .if n .RS 4 .nf # daxctl reconfigure\-device \-\-mode=system\-ram \-\-region=0 all libdaxctl: daxctl_dev_disable: dax3.0: error: device model is dax\-class dax3.0: disable failed: Operation not supported error reconfiguring devices: Operation not supported reconfigured 0 devices .fi .if n .RE .sp \fIdaxctl\-reconfigure\-device\fP nominally expects that it will online new memory blocks as \fImovable\fP, so that kernel data doesn\(cqt make it into this memory. However, there are other potential agents that may be configured to automatically online new hot\-plugged memory as it appears. Most notably, these are the \fI/sys/devices/system/memory/auto_online_blocks\fP configuration, or system udev rules. If such an agent races to online memory sections, daxctl checks if the blocks were onlined as \fImovable\fP memory. If this was not the case, and the memory blocks are found to be in a different zone, then a warning is displayed. If it is desired that a different agent control the onlining of memory blocks, and the associated memory zone, then it is recommended to use the \-\-no\-online option described below. This will abridge the device reconfiguration operation to just hotplugging the memory, and refrain from then onlining it. .SH "OPTIONS" .sp \-r, \-\-region= .RS 4 Restrict the operation to devices belonging to the specified region(s). A device\-dax region is a contiguous range of memory that hosts one or more /dev/daxX.Y devices, where X is the region id and Y is the device instance id. .RE .sp \-s, \-\-size= .RS 4 For regions that support dax device creation, change the device size in bytes. This option supports the suffixes "k" or "K" for KiB, "m" or "M" for MiB, "g" or "G" for GiB and "t" or "T" for TiB. .sp .if n .RS 4 .nf The size must be a multiple of the region alignment. .fi .if n .RE .sp .if n .RS 4 .nf This option is mutually exclusive with \-m or \-\-mode. .fi .if n .RE .RE .sp \-a, \-\-align .RS 4 Applications that want to establish dax memory mappings with page table entries greater than system base page size (4K on x86) need a device that is sufficiently aligned. This defaults to 2M. Note that "devdax" mode enforces all mappings to be aligned to this value, i.e. it fails unaligned mapping attempts. .sp .if n .RS 4 .nf This option is mutually exclusive with \-m or \-\-mode. .fi .if n .RE .RE .sp \-m, \-\-mode= .RS 4 Specify the mode to which the dax device(s) should be reconfigured. .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} "system\-ram": hotplug the device into system memory. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ . sp -1 . IP \(bu 2.3 .\} "devdax": switch to the normal "device dax" mode. This requires the kernel to support hot\-unplugging \fIkmem\fP based memory. If this is not available, a reboot is the only way to switch back to \fIdevdax\fP mode. .RE .RE .sp \-N, \-\-no\-online .RS 4 By default, memory sections provided by system\-ram devices will be brought online automatically and immediately with the \fIonline_movable\fP policy. Use this option to disable the automatic onlining behavior. .RE .sp \-\-no\-movable .RS 4 \fI\-\-movable\fP is the default. This can be overridden to online new memory such that it is not \fImovable\fP. This allows any allocation to potentially be served from this memory. This may preclude subsequent removal. With the \fI\-\-movable\fP behavior (which is default), kernel allocations will not consider this memory, and it will be reserved for application use. .RE .sp \-f, \-\-force .RS 4 When converting from "system\-ram" mode to "devdax", it is expected that all the memory sections are first made offline. By default, daxctl won\(cqt touch online memory. However with this option, attempt to offline the memory on the NUMA node associated with the dax device before converting it back to "devdax" mode. .RE .sp \-u, \-\-human .RS 4 By default the command will output machine\-friendly raw\-integer data. Instead, with this flag, numbers representing storage size will be formatted as human readable strings with units, other fields are converted to hexadecimal strings. .RE .sp \-v, \-\-verbose .RS 4 Emit more debug messages .RE .SH "COPYRIGHT" .sp Copyright \(co 2016 \- 2020, Intel Corporation. License GPLv2: GNU GPL version 2 \c .URL "http://gnu.org/licenses/gpl.html" "" "." This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" .sp daxctl\-list(1),daxctl\-migrate\-device\-model[1]