Skip to content

RFC PCI/P2PMEM: introduce pci_p2pdma_align_size API

Max Gurtovoy linux-mm linux-nvme lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest3 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3mm,memory_hotplug: export mhp min alignmentinclude/linux/memory_hotplug.h mm/memory_hotplug.c+24 -143 replies
2/3PCI/P2PMEM: introduce pci_p2pdma_align_size APIdrivers/pci/p2pdma.c include/linux/pci-p2pdma.h+28 -00 replies
3/3nvme-pci: align CMB size according to P2PMEM alignmentdrivers/nvme/host/pci.c+7 -02 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [RFC PATCH 0/3] PCI/P2PMEM: introduce pci_p2pdma_align_size API

Hi all,
In hotplugged memory (from check_pfn_span function):
"
Disallow all operations smaller than a sub-section and only allow operations smaller than a section for SPARSEMEM_VMEMMAP. Note that check_hotplug_memory_range() enforces a larger memory_block_size_bytes() granularity for memory that will be marked online, so this check should only fire for direct arch_{add,remove}_memory() users outside of add_memory_resource()
"

This restriction will disqualify, for example, large NVMe CMBs that might have non power of 2 number of pages (e.g. 32767 pages of 4KB). For these devices, the CMB size will be rounded down from 0x7fff000 to 0x7e00000 but it's better than having un-mapped CMB.

If we all agree on the approach, this RFC can assist as-is to these NVMe devices and other P2PMEM devices in the future and can considered for the next merge window.

Max Gurtovoy (3):
mm,memory_hotplug: export mhp min alignment PCI/P2PMEM: introduce pci_p2pdma_align_size API
nvme-pci: align CMB size according to P2PMEM alignment

 drivers/nvme/host/pci.c        |  7 +++++++
 drivers/pci/p2pdma.c           | 23 +++++++++++++++++++++++
 include/linux/memory_hotplug.h |  5 +++++
 include/linux/pci-p2pdma.h     |  5 +++++
 mm/memory_hotplug.c            | 33 +++++++++++++++++++--------------
 5 files changed, 59 insertions(+), 14 deletions(-)
Signature · 1 line
2.18.1