linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] Add managed SOFT RESERVE resource handling
@ 2025-01-16 17:42 Nathan Fontenot
  2025-01-16 17:42 ` [PATCH v2 1/4] kernel/resource: Introduce managed SOFT RESERVED resources Nathan Fontenot
                   ` (3 more replies)
  0 siblings, 4 replies; 25+ messages in thread
From: Nathan Fontenot @ 2025-01-16 17:42 UTC (permalink / raw)
  To: linux-cxl; +Cc: dan.j.williams, alison.schofield, linux-mm, gourry

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(-)

-- 
2.43.0



^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2025-03-23  8:33 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-16 17:42 [PATCH v2 0/4] Add managed SOFT RESERVE resource handling Nathan Fontenot
2025-01-16 17:42 ` [PATCH v2 1/4] kernel/resource: Introduce managed SOFT RESERVED resources Nathan Fontenot
2025-01-21  8:19   ` David Hildenbrand
2025-01-21 18:57     ` Fontenot, Nathan
2025-01-22  6:03       ` Fan Ni
2025-01-23 15:49         ` Fontenot, Nathan
2025-01-27 14:40           ` David Hildenbrand
2025-01-27 18:46             ` Fontenot, Nathan
2025-03-07  5:56               ` Zhijian Li (Fujitsu)
2025-03-07 16:47                 ` Alison Schofield
2025-03-10  5:52                   ` Li Zhijian
2025-03-07 23:05                 ` Bowman, Terry
2025-03-10  6:00                   ` Zhijian Li (Fujitsu)
2025-03-23  8:24                   ` Zhijian Li (Fujitsu)
2025-03-23  8:33                     ` Zhijian Li (Fujitsu)
2025-01-22  5:52   ` Fan Ni
2025-01-23 15:55     ` Fontenot, Nathan
2025-01-16 17:42 ` [PATCH v2 2/4] cxl: Update Soft Reserve resources upon region creation Nathan Fontenot
2025-01-16 17:42 ` [PATCH v2 3/4] dax: Update hmem resource/device registration Nathan Fontenot
2025-01-16 22:28   ` Ira Weiny
2025-01-21 18:49     ` Fontenot, Nathan
2025-01-21 23:14       ` Ira Weiny
2025-01-23 16:01         ` Fontenot, Nathan
2025-01-27 18:44           ` Fontenot, Nathan
2025-01-16 17:42 ` [PATCH v2 4/4] Add SOFT RESERVE resource notification chain Nathan Fontenot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox