linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/4] Add managed SOFT RESERVE resource handling
@ 2025-04-03 18:33 Terry Bowman
  2025-04-03 18:33 ` [PATCH v3 1/4] kernel/resource: Provide mem region release for SOFT RESERVES Terry Bowman
                   ` (4 more replies)
  0 siblings, 5 replies; 21+ messages in thread
From: Terry Bowman @ 2025-04-03 18:33 UTC (permalink / raw)
  To: dave, jonathan.cameron, dave.jiang, alison.schofield,
	vishal.l.verma, ira.weiny, dan.j.williams, willy, jack, rafael,
	len.brown, pavel, ming.li, nathan.fontenot,
	Smita.KoralahalliChannabasappa, huang.ying.caritas, yaoxt.fnst,
	peterz, gregkh, quic_jjohnson, ilpo.jarvinen, bhelgaas,
	andriy.shevchenko, mika.westerberg, akpm, gourry, linux-cxl,
	linux-kernel, nvdimm, linux-fsdevel, linux-pm, rrichter,
	benjamin.cheatham, PradeepVineshReddy.Kodamati, lizhijian

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 approach 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 the driver walks through any created CXL regions to trim any
intersections with SOFT RESERVE resources in 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.

V3 updates:
 - Remove srmem resource tree from kernel/resource.c, this is no longer
   needed in the current implementation. All SOFT RESERVE resources now
   put on the iomem resource tree.
 - Remove the no longer needed SOFT_RESERVED_MANAGED kernel config option.
 - Add the 'nid' parameter back to hmem_register_resource();
 - Remove the no longer used soft reserve notification chain (introduced
   in v2). The dax driver is now notified of SOFT RESERVED resources by
   the CXL driver.

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: Provide mem region release for SOFT RESERVES
  cxl: Update Soft Reserved resources upon region creation
  dax/mum: Save the dax mum platform device pointer
  cxl/dax: Delay consumption of SOFT RESERVE resources

 drivers/cxl/Kconfig        |  4 ---
 drivers/cxl/acpi.c         | 28 +++++++++++++++++++
 drivers/cxl/core/Makefile  |  2 +-
 drivers/cxl/core/region.c  | 34 ++++++++++++++++++++++-
 drivers/cxl/core/suspend.c | 41 ++++++++++++++++++++++++++++
 drivers/cxl/cxl.h          |  3 +++
 drivers/cxl/cxlmem.h       |  9 -------
 drivers/cxl/cxlpci.h       |  1 +
 drivers/cxl/pci.c          |  2 ++
 drivers/dax/hmem/device.c  | 47 ++++++++++++++++----------------
 drivers/dax/hmem/hmem.c    | 10 ++++---
 include/linux/dax.h        | 11 +++++---
 include/linux/ioport.h     |  3 +++
 include/linux/pm.h         |  7 -----
 kernel/resource.c          | 55 +++++++++++++++++++++++++++++++++++---
 15 files changed, 202 insertions(+), 55 deletions(-)


base-commit: aae0594a7053c60b82621136257c8b648c67b512
-- 
2.34.1


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

end of thread, other threads:[~2025-04-14 14:12 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-03 18:33 [PATCH v3 0/4] Add managed SOFT RESERVE resource handling Terry Bowman
2025-04-03 18:33 ` [PATCH v3 1/4] kernel/resource: Provide mem region release for SOFT RESERVES Terry Bowman
2025-04-03 18:40   ` Andy Shevchenko
2025-04-03 18:50     ` Bowman, Terry
2025-04-04 12:57   ` kernel test robot
2025-04-04 13:16   ` Jonathan Cameron
2025-04-04 13:25     ` Andy Shevchenko
2025-04-10 15:07       ` Bowman, Terry
2025-04-10 14:49     ` Bowman, Terry
2025-04-03 18:33 ` [PATCH v3 2/4] cxl: Update Soft Reserved resources upon region creation Terry Bowman
2025-04-04 13:32   ` Jonathan Cameron
2025-04-10 15:57     ` Bowman, Terry
2025-04-04 13:58   ` kernel test robot
2025-04-03 18:33 ` [PATCH v3 3/4] dax/mum: Save the dax mum platform device pointer Terry Bowman
2025-04-04 13:34   ` Jonathan Cameron
2025-04-10 18:27     ` Bowman, Terry
2025-04-03 18:33 ` [PATCH v3 4/4] cxl/dax: Delay consumption of SOFT RESERVE resources Terry Bowman
2025-04-04 13:38   ` Jonathan Cameron
2025-04-07  7:31 ` [PATCH v3 0/4] Add managed SOFT RESERVE resource handling Zhijian Li (Fujitsu)
2025-04-07 22:35   ` Bowman, Terry
2025-04-14 14:11   ` Bowman, Terry

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).