Re: [v4 2/2] device-dax: "Hotremove" persistent memory that is used like normal RAM

From: Sasha Levin
Date: Thu May 02 2019 - 13:34:51 EST

On Wed, May 01, 2019 at 03:18:46PM -0400, Pavel Tatashin wrote:
It is now allowed to use persistent memory like a regular RAM, but
currently there is no way to remove this memory until machine is

This work expands the functionality to also allows hotremoving
previously hotplugged persistent memory, and recover the device for use
for other purposes.

To hotremove persistent memory, the management software must first
offline all memory blocks of dax region, and than unbind it from
device-dax/kmem driver. So, operations should look like this:

echo offline > echo offline > /sys/devices/system/memory/memoryN/state

This looks wrong :)