Re: [PATCH 4/4] dax: "Hotplug" persistent memory for use like normal RAM

From: Dan Williams
Date: Thu Jan 17 2019 - 11:56:23 EST

On Wed, Jan 16, 2019 at 9:21 PM Du, Fan <fan.du@xxxxxxxxx> wrote:
> >From: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
> >
> >Currently, a persistent memory region is "owned" by a device driver,
> >either the "Direct DAX" or "Filesystem DAX" drivers. These drivers
> >allow applications to explicitly use persistent memory, generally
> >by being modified to use special, new libraries.
> >
> >However, this limits persistent memory use to applications which
> >*have* been modified. To make it more broadly usable, this driver
> >"hotplugs" memory into the kernel, to be managed ad used just like
> >normal RAM would be.
> >
> >To make this work, management software must remove the device from
> >being controlled by the "Device DAX" infrastructure:
> >
> > echo -n dax0.0 > /sys/bus/dax/drivers/device_dax/remove_id
> > echo -n dax0.0 > /sys/bus/dax/drivers/device_dax/unbind
> >
> >and then bind it to this new driver:
> >
> > echo -n dax0.0 > /sys/bus/dax/drivers/kmem/new_id
> > echo -n dax0.0 > /sys/bus/dax/drivers/kmem/bind
> Is there any plan to introduce additional mode, e.g. "kmem" in the userspace
> ndctl tool to do the configuration?

Yes, but not to ndctl. The daxctl tool will grow a helper for this.
The policy of what device-dax instances should be hotplugged at system
init will be managed by a persistent configuration file and udev