From: Li Ming <ming.li@zohomail.com>
To: Alison Schofield <alison.schofield@intel.com>
Cc: nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org
Subject: Re: [ndctl PATCH 1/1] daxctl: Output more information if memblock is unremovable
Date: Wed, 11 Dec 2024 15:30:50 +0800 [thread overview]
Message-ID: <22f74b5c-e781-4f82-8205-c1349095cd3a@zohomail.com> (raw)
In-Reply-To: <Z1JO7WUKwTcBVIYA@aschofie-mobl2.lan>
On 12/6/2024 9:10 AM, Alison Schofield wrote:
> On Thu, Dec 05, 2024 at 12:14:56AM +0800, Li Ming wrote:
>> If CONFIG_MEMORY_HOTREMOVE is disabled by kernel, memblocks will not be
>> removed, so 'dax offline-memory all' will output below error logs:
>>
>> libdaxctl: offline_one_memblock: dax0.0: Failed to offline /sys/devices/system/node/node6/memory371/state: Invalid argument
>> dax0.0: failed to offline memory: Invalid argument
>> error offlining memory: Invalid argument
>> offlined memory for 0 devices
>>
>> The log does not clearly show why the command failed. So checking if the
>> target memblock is removable before offlining it by querying
>> '/sys/devices/system/node/nodeX/memoryY/removable', then output specific
>> logs if the memblock is unremovable, output will be:
>>
>> libdaxctl: offline_one_memblock: dax0.0: memory371 is unremovable
>> dax0.0: failed to offline memory: Operation not supported
>> error offlining memory: Operation not supported
>> offlined memory for 0 devices
>>
> Hi Ming,
>
> This led me to catch up on movable and removable in DAX context.
> Not all 'Movable' DAX memory is 'Removable' right?
>
> Would it be useful to add 'removable' to the daxctl list json:
>
> # daxctl list
> [
> {
> "chardev":"dax0.0",
> "size":536870912,
> "target_node":0,
> "align":2097152,
> "mode":"system-ram",
> "online_memblocks":4,
> "total_memblocks":4,
> "movable":true
> "removable":false <----
> }
> ]
Hi Alison,
After investigation, if there is no "movable" in dax list json, that means the kernel does not support MEMORY_HOTREMOVE.
if there is a "movable" in dax list json, that means the kernel supports MEMORY_HOTREMOVE and the value of "movable" decides if memblocks can be offlined. So user cannot offline the memblocks if "movable" is false and "removable" is true.
Feels like the "removable" field does not make much sense in kernel supporting MEMORY_HOTREMOVE case. user can use "movable" to check if memblocks can be offlined. do you think if it is still worth adding a "removable" in daxctl list json?
Thanks
Ming
next prev parent reply other threads:[~2024-12-11 7:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-04 16:14 [ndctl PATCH 1/1] daxctl: Output more information if memblock is unremovable Li Ming
2024-12-06 1:10 ` Alison Schofield
2024-12-06 7:06 ` Li Ming
2024-12-11 7:30 ` Li Ming [this message]
2025-01-08 16:46 ` Dave Jiang
2025-01-09 0:58 ` Li Ming
2025-01-09 15:06 ` Dave Jiang
2025-02-09 1:46 ` Alison Schofield
2025-03-03 20:04 ` Alison Schofield
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=22f74b5c-e781-4f82-8205-c1349095cd3a@zohomail.com \
--to=ming.li@zohomail.com \
--cc=alison.schofield@intel.com \
--cc=linux-cxl@vger.kernel.org \
--cc=nvdimm@lists.linux.dev \
/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