NVDIMM Device and Persistent Memory development
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: Xiao Yang <yangx.jy@fujitsu.com>, <vishal.l.verma@intel.com>,
	<nvdimm@lists.linux.dev>
Cc: <linux-cxl@vger.kernel.org>, Xiao Yang <yangx.jy@fujitsu.com>
Subject: RE: [NDCTL PATCH 2/2] daxctl: Force to offline memory by param.force
Date: Tue, 16 Jan 2024 16:25:06 -0800	[thread overview]
Message-ID: <65a71e6296de9_3b8e294e7@dwillia2-xfh.jf.intel.com.notmuch> (raw)
In-Reply-To: <20230810053958.14992-2-yangx.jy@fujitsu.com>

Xiao Yang wrote:
> Try to make daxctl reconfigure-device with system-ram mode
> offline memory when both param.no_online and param.force
> are set but daxctl_dev_will_auto_online_memory returns true.

So is the goal here to try to save some steps in the case where the
kernel already onlined the device?

It should probably emit a warning that the memory was onlined
automatically so the admin can consider changing the default kernel
policy. Otherwise, it may be too late to undo the onlining at this
point.

> 
> Signed-off-by: Xiao Yang <yangx.jy@fujitsu.com>
> ---
>  daxctl/device.c | 9 +++++++--
>  1 file changed, 7 insertions(+), 2 deletions(-)
> 
> diff --git a/daxctl/device.c b/daxctl/device.c
> index ba31eb6..dfa7f79 100644
> --- a/daxctl/device.c
> +++ b/daxctl/device.c
> @@ -83,7 +83,7 @@ OPT_STRING('m', "mode", &param.mode, "mode", "mode to switch the device to"), \
>  OPT_BOOLEAN('N', "no-online", &param.no_online, \
>  	"don't auto-online memory sections"), \
>  OPT_BOOLEAN('f', "force", &param.force, \
> -		"attempt to offline memory sections before reconfiguration"), \
> +		"attempt to offline memory sections for reconfiguration"), \
>  OPT_BOOLEAN('C', "check-config", &param.check_config, \
>  		"use config files to determine parameters for the operation")
>  
> @@ -734,8 +734,13 @@ static int reconfig_mode_system_ram(struct daxctl_dev *dev)
>  			return rc;
>  	}
>  
> -	if (param.no_online)
> +	if (param.no_online) {
> +		if (param.force && daxctl_dev_will_auto_online_memory(dev)) {
> +			rc = dev_offline_memory(dev);
> +			return rc;

It is not clear that this is an error that should fail the
reconfigure-device, because the reconfiguration succeeded. The fact that
the kernel policy forced the memory online is the administrators fault
for setting conflicting policy. This is why I think a warning is
appropriate because the administrator is confused if they are letting
kernel an daxctl policy conflict.

  reply	other threads:[~2024-01-17  0:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-10  5:39 [NDCTL PATCH 1/2] daxctl: Don't check param.no_movable when param.no_online is set Xiao Yang
2023-08-10  5:39 ` [NDCTL PATCH 2/2] daxctl: Force to offline memory by param.force Xiao Yang
2024-01-17  0:25   ` Dan Williams [this message]
2023-10-09  9:40 ` [NDCTL PATCH 1/2] daxctl: Don't check param.no_movable when param.no_online is set Xiao Yang (Fujitsu)
2024-01-15  0:12   ` Xiao Yang
2024-01-17  0:16 ` Dan Williams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=65a71e6296de9_3b8e294e7@dwillia2-xfh.jf.intel.com.notmuch \
    --to=dan.j.williams@intel.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=nvdimm@lists.linux.dev \
    --cc=vishal.l.verma@intel.com \
    --cc=yangx.jy@fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).