Skip to content

Allow persistent memory to be used like normal RAM

Dave Hansen linux-mm linux-nvdimm lkml nvdimm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest9 patches 16 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9mm/resource: return real error codes from walk failureskernel/resource.c+2 -20 replies
2/9dax: kernel memory driver for mm ownership of DAXdrivers/dax/kmem.c+152 -01 reply
3/9dax: add more kmem device infrastructuredrivers/dax/kmem.c include/uapi/linux/ndctl.h+7 -50 replies
4/9dax/kmem: allow PMEM devices to bind to KMEM driverdrivers/nvdimm/bus.c+14 -10 replies
5/9dax/kmem: add more nd dax kmem infrastructuredrivers/nvdimm/bus.c drivers/nvdimm/dax_devs.c drivers/nvdimm/nd.h+43 -00 replies
6/9mm/memory-hotplug: allow memory resources to be childrenmm/memory_hotplug.c+14 -170 replies
7/9dax/kmem: actually perform memory hotplugdrivers/dax/kmem.c+25 -30 replies
8/9dax/kmem: let walk_system_ram_range() search child resourceskernel/resource.c+4 -10 replies
9/9dax/kmem: actually enable the code in Makefiledrivers/dax/Makefile+2 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/9] Allow persistent memory to be used like normal RAM

Persistent memory is cool. But, currently, you have to rewrite your applications to use it. Wouldn't it be cool if you could just have it show up in your system like normal RAM and get to it like a slow blob of memory? Well... have I got the patch series for you!

This series adds a new "driver" to which pmem devices can be attached. Once attached, the memory "owned" by the device is hot-added to the kernel and managed like any other memory. On systems with an HMAT (a new ACPI table), each socket (roughly) will have a separate NUMA node for its persistent memory so this newly-added memory can be selected by its unique NUMA node.

This is highly RFC, and I really want the feedback from the nvdimm/pmem folks about whether this is a viable long-term perversion of their code and device mode. It's insufficiently documented and probably not bisectable either.

Todo:
1. The device re-binding hacks are ham-fisted at best. We need a better way of doing this, especially so the kmem driver does not get in the way of normal pmem devices.
2. When the device has no proper node, we default it to NUMA node 0. Is that OK?
3. We muck with the 'struct resource' code quite a bit. It definitely needs a once-over from folks more familiar with it than I.
4. Is there a better way to do this than starting with a copy of pmem.c?

Here's how I set up a system to test this thing:

1. Boot qemu with lots of memory: "-m 4096", for instance
2. Reserve 512MB of physical memory. Reserving a spot a 2GB physical seems to work: memmap=512M!0x0000000080000000 This will end up looking like a pmem device at boot.
3. When booted, convert fsdax device to "device dax":
ndctl create-namespace -fe namespace0.0 -m dax
4. In the background, the kmem driver will probably bind to the new device.
5. Now, online the new memory sections. Perhaps:

grep ^MemTotal /proc/meminfo
for f in grep -vl online /sys/devices/system/memory/*/state; do
echo $f: cat $f
echo online > $f
grep ^MemTotal /proc/meminfo
done

Cc: Dan Williams <[email protected]>
Cc: Dave Jiang <[email protected]>
Cc: Ross Zwisler <[email protected]>
Cc: Vishal Verma <[email protected]>
Cc: Tom Lendacky <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: Huang Ying <[email protected]>
Cc: Fengguang Wu <[email protected]>
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm