diff mbox series

[ndctl,2/2] daxctl: Fix create-device manual

Message ID 20240527064539.819487-2-lizhijian@fujitsu.com
State Superseded
Headers show
Series [ndctl,1/2] daxctl: Fix create-device parameters parsing | expand

Commit Message

Li Zhijian May 27, 2024, 6:45 a.m. UTC
create-device can accept more options, see `daxctl help create-device`
or the code for more details.

Reuse reconfigure options from reconfigure-device and include movable
options.

Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
---
 Documentation/daxctl/daxctl-create-device.txt |  2 +
 .../daxctl/daxctl-reconfigure-device.txt      | 39 +-----------------
 Documentation/daxctl/reconfigure-options.txt  | 40 +++++++++++++++++++
 3 files changed, 43 insertions(+), 38 deletions(-)
 create mode 100644 Documentation/daxctl/reconfigure-options.txt

Comments

Li Zhijian May 27, 2024, 8:34 a.m. UTC | #1
Hold on, Hold on

It seems the manual is correct, the usage is wrong.
Current code only implements BASE_OPTIONS() and CREATE_OPTIONS() for create-device command.
RECONFIG_OPTIONS() and ZONE_OPTIONS() have not supported yet.

   71 #define BASE_OPTIONS() \
   72 OPT_STRING('r', "region", &param.region, "region-id", "filter by region"), \
   73 OPT_BOOLEAN('u', "human", &param.human, "use human friendly number formats"), \
   74 OPT_BOOLEAN('v', "verbose", &param.verbose, "emit more debug messages")
   75
   76 #define RECONFIG_OPTIONS() \
   77 OPT_STRING('m', "mode", &param.mode, "mode", "mode to switch the device to"), \
   78 OPT_BOOLEAN('N', "no-online", &param.no_online, \
   79         "don't auto-online memory sections"), \
   80 OPT_BOOLEAN('f', "force", &param.force, \
   81                 "attempt to offline memory sections before reconfiguration"), \
   82 OPT_BOOLEAN('C', "check-config", &param.check_config, \
   83                 "use config files to determine parameters for the operation")
   84
   85 #define CREATE_OPTIONS() \
   86 OPT_STRING('s', "size", &param.size, "size", "size to switch the device to"), \
   87 OPT_STRING('a', "align", &param.align, "align", "alignment to switch the device to"), \
   88 OPT_STRING('\0', "input", &param.input, "input", "input device JSON file")
   89
   90 #define DESTROY_OPTIONS() \
   91 OPT_BOOLEAN('f', "force", &param.force, \
   92                 "attempt to disable before destroying device")
   93
   94 #define ZONE_OPTIONS() \
   95 OPT_BOOLEAN('\0', "no-movable", &param.no_movable, \
   96                 "online memory in ZONE_NORMAL")

==========================================
  usage: daxctl create-device [<options>]

     -r, --region <region-id>
                           filter by region
     -u, --human           use human friendly number formats
     -v, --verbose         emit more debug messages
     -s, --size <size>     size to switch the device to
     -a, --align <align>   alignment to switch the device to
         --input <input>   input device JSON file
     -m, --mode <mode>     mode to switch the device to
     -N, --no-online       don't auto-online memory sections
     -f, --force           attempt to offline memory sections before reconfiguration
     -C, --check-config    use config files to determine parameters for the operation
         --no-movable      online memory in ZONE_NORMAL



On 27/05/2024 14:45, Li Zhijian wrote:
> create-device can accept more options, see `daxctl help create-device`
> or the code for more details.
> 
> Reuse reconfigure options from reconfigure-device and include movable
> options.
> 
> Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
> ---
>   Documentation/daxctl/daxctl-create-device.txt |  2 +
>   .../daxctl/daxctl-reconfigure-device.txt      | 39 +-----------------
>   Documentation/daxctl/reconfigure-options.txt  | 40 +++++++++++++++++++
>   3 files changed, 43 insertions(+), 38 deletions(-)
>   create mode 100644 Documentation/daxctl/reconfigure-options.txt
> 
> diff --git a/Documentation/daxctl/daxctl-create-device.txt b/Documentation/daxctl/daxctl-create-device.txt
> index 05f4dbd9d61c..ad6f177fa3b9 100644
> --- a/Documentation/daxctl/daxctl-create-device.txt
> +++ b/Documentation/daxctl/daxctl-create-device.txt
> @@ -72,6 +72,8 @@ EFI memory map with EFI_MEMORY_SP. The resultant ranges mean that it's
>   OPTIONS
>   -------
>   include::region-option.txt[]
> +include::movable-options.txt[]
> +include::reconfigure-options.txt[]
>   
>   -s::
>   --size=::
> diff --git a/Documentation/daxctl/daxctl-reconfigure-device.txt b/Documentation/daxctl/daxctl-reconfigure-device.txt
> index 09691d202514..32f28a5b8e82 100644
> --- a/Documentation/daxctl/daxctl-reconfigure-device.txt
> +++ b/Documentation/daxctl/daxctl-reconfigure-device.txt
> @@ -196,47 +196,10 @@ include::region-option.txt[]
>   
>   	This option is mutually exclusive with -m or --mode.
>   
> --m::
> ---mode=::
> -	Specify the mode to which the dax device(s) should be reconfigured.
> -	- "system-ram": hotplug the device into system memory.
> -
> -	- "devdax": switch to the normal "device dax" mode. This requires the
> -	  kernel to support hot-unplugging 'kmem' based memory. If this is not
> -	  available, a reboot is the only way to switch back to 'devdax' mode.
> -
> --N::
> ---no-online::
> -	By default, memory sections provided by system-ram devices will be
> -	brought online automatically and immediately with the 'online_movable'
> -	policy. Use this option to disable the automatic onlining behavior.
> -
> --C::
> ---check-config::
> -	Get reconfiguration parameters from the global daxctl config file.
> -	This is typically used when daxctl-reconfigure-device is called from
> -	a systemd-udevd device unit file. The reconfiguration proceeds only
> -	if the match parameters in a 'reconfigure-device' section of the
> -	config match the dax device specified on the command line. See the
> -	'PERSISTENT RECONFIGURATION' section for more details.
> +include::reconfigure-options.txt[]
>   
>   include::movable-options.txt[]
>   
> --f::
> ---force::
> -	- When converting from "system-ram" mode to "devdax", it is expected
> -	that all the memory sections are first made offline. By default,
> -	daxctl won't 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.
> -
> -	- Additionally, if a kernel policy to auto-online blocks is detected,
> -	reconfiguration to system-ram fails. With this option, the failure can
> -	be overridden to allow reconfiguration regardless of kernel policy.
> -	Doing this may result in a successful reconfiguration, but it may
> -	not be possible to subsequently offline the memory without a reboot.
> -
> -
>   include::human-option.txt[]
>   
>   include::verbose-option.txt[]
> diff --git a/Documentation/daxctl/reconfigure-options.txt b/Documentation/daxctl/reconfigure-options.txt
> new file mode 100644
> index 000000000000..f174729eb023
> --- /dev/null
> +++ b/Documentation/daxctl/reconfigure-options.txt
> @@ -0,0 +1,40 @@
> +// SPDX-License-Identifier: GPL-2.0
> +
> +
> +-m::
> +--mode=::
> +	Specify the mode to which the dax device(s) should be reconfigured.
> +	- "system-ram": hotplug the device into system memory.
> +
> +	- "devdax": switch to the normal "device dax" mode. This requires the
> +	  kernel to support hot-unplugging 'kmem' based memory. If this is not
> +	  available, a reboot is the only way to switch back to 'devdax' mode.
> +
> +-N::
> +--no-online::
> +	By default, memory sections provided by system-ram devices will be
> +	brought online automatically and immediately with the 'online_movable'
> +	policy. Use this option to disable the automatic onlining behavior.
> +
> +-C::
> +--check-config::
> +	Get reconfiguration parameters from the global daxctl config file.
> +	This is typically used when daxctl-reconfigure-device is called from
> +	a systemd-udevd device unit file. The reconfiguration proceeds only
> +	if the match parameters in a 'reconfigure-device' section of the
> +	config match the dax device specified on the command line. See the
> +	'PERSISTENT RECONFIGURATION' section for more details.
> +
> +-f::
> +--force::
> +	- When converting from "system-ram" mode to "devdax", it is expected
> +	that all the memory sections are first made offline. By default,
> +	daxctl won't 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.
> +
> +	- Additionally, if a kernel policy to auto-online blocks is detected,
> +	reconfiguration to system-ram fails. With this option, the failure can
> +	be overridden to allow reconfiguration regardless of kernel policy.
> +	Doing this may result in a successful reconfiguration, but it may
> +	not be possible to subsequently offline the memory without a reboot.
diff mbox series

Patch

diff --git a/Documentation/daxctl/daxctl-create-device.txt b/Documentation/daxctl/daxctl-create-device.txt
index 05f4dbd9d61c..ad6f177fa3b9 100644
--- a/Documentation/daxctl/daxctl-create-device.txt
+++ b/Documentation/daxctl/daxctl-create-device.txt
@@ -72,6 +72,8 @@  EFI memory map with EFI_MEMORY_SP. The resultant ranges mean that it's
 OPTIONS
 -------
 include::region-option.txt[]
+include::movable-options.txt[]
+include::reconfigure-options.txt[]
 
 -s::
 --size=::
diff --git a/Documentation/daxctl/daxctl-reconfigure-device.txt b/Documentation/daxctl/daxctl-reconfigure-device.txt
index 09691d202514..32f28a5b8e82 100644
--- a/Documentation/daxctl/daxctl-reconfigure-device.txt
+++ b/Documentation/daxctl/daxctl-reconfigure-device.txt
@@ -196,47 +196,10 @@  include::region-option.txt[]
 
 	This option is mutually exclusive with -m or --mode.
 
--m::
---mode=::
-	Specify the mode to which the dax device(s) should be reconfigured.
-	- "system-ram": hotplug the device into system memory.
-
-	- "devdax": switch to the normal "device dax" mode. This requires the
-	  kernel to support hot-unplugging 'kmem' based memory. If this is not
-	  available, a reboot is the only way to switch back to 'devdax' mode.
-
--N::
---no-online::
-	By default, memory sections provided by system-ram devices will be
-	brought online automatically and immediately with the 'online_movable'
-	policy. Use this option to disable the automatic onlining behavior.
-
--C::
---check-config::
-	Get reconfiguration parameters from the global daxctl config file.
-	This is typically used when daxctl-reconfigure-device is called from
-	a systemd-udevd device unit file. The reconfiguration proceeds only
-	if the match parameters in a 'reconfigure-device' section of the
-	config match the dax device specified on the command line. See the
-	'PERSISTENT RECONFIGURATION' section for more details.
+include::reconfigure-options.txt[]
 
 include::movable-options.txt[]
 
--f::
---force::
-	- When converting from "system-ram" mode to "devdax", it is expected
-	that all the memory sections are first made offline. By default,
-	daxctl won't 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.
-
-	- Additionally, if a kernel policy to auto-online blocks is detected,
-	reconfiguration to system-ram fails. With this option, the failure can
-	be overridden to allow reconfiguration regardless of kernel policy.
-	Doing this may result in a successful reconfiguration, but it may
-	not be possible to subsequently offline the memory without a reboot.
-
-
 include::human-option.txt[]
 
 include::verbose-option.txt[]
diff --git a/Documentation/daxctl/reconfigure-options.txt b/Documentation/daxctl/reconfigure-options.txt
new file mode 100644
index 000000000000..f174729eb023
--- /dev/null
+++ b/Documentation/daxctl/reconfigure-options.txt
@@ -0,0 +1,40 @@ 
+// SPDX-License-Identifier: GPL-2.0
+
+
+-m::
+--mode=::
+	Specify the mode to which the dax device(s) should be reconfigured.
+	- "system-ram": hotplug the device into system memory.
+
+	- "devdax": switch to the normal "device dax" mode. This requires the
+	  kernel to support hot-unplugging 'kmem' based memory. If this is not
+	  available, a reboot is the only way to switch back to 'devdax' mode.
+
+-N::
+--no-online::
+	By default, memory sections provided by system-ram devices will be
+	brought online automatically and immediately with the 'online_movable'
+	policy. Use this option to disable the automatic onlining behavior.
+
+-C::
+--check-config::
+	Get reconfiguration parameters from the global daxctl config file.
+	This is typically used when daxctl-reconfigure-device is called from
+	a systemd-udevd device unit file. The reconfiguration proceeds only
+	if the match parameters in a 'reconfigure-device' section of the
+	config match the dax device specified on the command line. See the
+	'PERSISTENT RECONFIGURATION' section for more details.
+
+-f::
+--force::
+	- When converting from "system-ram" mode to "devdax", it is expected
+	that all the memory sections are first made offline. By default,
+	daxctl won't 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.
+
+	- Additionally, if a kernel policy to auto-online blocks is detected,
+	reconfiguration to system-ram fails. With this option, the failure can
+	be overridden to allow reconfiguration regardless of kernel policy.
+	Doing this may result in a successful reconfiguration, but it may
+	not be possible to subsequently offline the memory without a reboot.