Skip to content

Add managed SOFT RESERVE resource handling

Nathan Fontenot linux-cxl linux-mm 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest4 patches 20 repliesIn review

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4kernel/resource: Introduce managed SOFT RESERVED resourcesinclude/linux/ioport.h kernel/resource.c lib/Kconfig+87 -515 replies
2/4cxl: Update Soft Reserve resources upon region creationdrivers/cxl/Kconfig drivers/cxl/acpi.c drivers/cxl/core/Makefile +6 more+99 -110 replies
3/4dax: Update hmem resource/device registrationdrivers/acpi/numa/hmat.c drivers/dax/hmem/device.c drivers/dax/hmem/hmem.c +1 more+20 -225 replies
4/4Add SOFT RESERVE resource notification chaindrivers/dax/hmem/hmem.c include/linux/ioport.h kernel/resource.c+55 -10 replies

Reviews trailers per patch

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

Read the v2 thread

Cover letter [PATCH v2 0/4] Add managed SOFT RESERVE resource handling

Add the ability to manage SOFT RESERVE iomem resources prior to them being added to the iomem resource tree. This allows drivers, such as CXL, to remove any pieces of the SOFT RESERVE resource that intersect with created CXL regions.

The current approac of leaving the SOFT RESERVE resources as is can cause failures during hotplug of devices, such as CXL, because the resource is not available for reuse after teardown of the device.

The approach is to add SOFT RESERVE resources to a separate tree during boot. This allows any drivers to update the SOFT RESERVE resources before they are merged into the iomem resource tree. In addition a notifier chain is added so that drivers can be notified when these SOFT RESERVE resources are added to the ioeme resource tree.

The CXL driver is modified to use a worker thread that waits for the CXL PCI and CXL mem drivers to be loaded and for their probe routine to complete. Then walks through any created CXL regions to remove pieces that intersect with SOFT RESERVE resources from the SOFT RESERVES before adding the SOFT RESERVES to the iomem tree.

The dax driver uses the new soft reserve notifier chain so it can consume any remaining SOFT RESERVES once they're added to the iomem tree.

v2 updates:
- Add config option SOFT_RESERVE_MANAGED to control use of the separate srmem resource tree at boot.
- Only add SOFT RESERVE resources to the soft reserve tree during boot, they go to the iomem resource tree after boot.
- Remove the resource trimming code in the previous patch to re-use the existing code in kernel/resource.c
-Add functionality for the cxl acpi driver to wait for the cxl PCI and me drivers to load.

Nathan Fontenot (4):
kernel/resource: Introduce managed SOFT RESERVED resources
cxl: Update Soft Reserve resources upon region creation
dax: Update hmem resource/device registration Add SOFT RESERVE resource notification chain

 drivers/acpi/numa/hmat.c   |   7 +--
 drivers/cxl/Kconfig        |   1 +
 drivers/cxl/acpi.c         |  26 ++++++++++
 drivers/cxl/core/Makefile  |   2 +-
 drivers/cxl/core/region.c  |  25 +++++++++-
 drivers/cxl/core/suspend.c |  41 +++++++++++++++
 drivers/cxl/cxl.h          |   3 ++
 drivers/cxl/cxlmem.h       |   9 ----
 drivers/cxl/cxlpci.h       |   2 +
 drivers/cxl/pci.c          |   1 +
 drivers/dax/hmem/device.c  |  14 +++---
 drivers/dax/hmem/hmem.c    |  34 +++++++++++--
 include/linux/dax.h        |   9 ++--
 include/linux/ioport.h     |  20 ++++++++
 kernel/resource.c          | 100 +++++++++++++++++++++++++++++++++++--
 lib/Kconfig                |   4 ++
 16 files changed, 260 insertions(+), 38 deletions(-)
Signature · 1 line
2.43.0