Dan Williams wrote: > Nathan Fontenot wrote: > > Update handling of SOFT RESERVE iomem resources that intersect with > > CXL region resources to remove the intersections from the SOFT RESERVE > > resources. The current approach of leaving the SOFT RESERVE > > resource as is can cause failures during hotplug replace of CXL > > devices because the resource is not available for reuse after > > teardown of the CXL device. > > > > The approach is to trim out any pieces of SOFT RESERVE resources > > that intersect CXL regions. To do this, first set aside any SOFT RESERVE > > resources that intersect with a CFMWS into a separate resource tree > > during e820__reserve_resources_late() that would have been otherwise > > added to the iomem resource tree. > > > > As CXL regions are created the cxl resource created for the new > > region is used to trim intersections from the SOFT RESERVE > > resources that were previously set aside. > > > > Once CXL device probe has completed ant remaining SOFT RESERVE resources > > remaining are added to the iomem resource tree. As each resource > > is added to the oiomem resource tree a new notifier chain is invoked > > to notify the dax driver of newly added SOFT RESERVE resources so that > > the dax driver can consume them. > > Hi Nathan, this patch hit on all the mechanisms I would expect, but upon > reading it there is an opportunity to zoom out and do something blunter > than the surgical precision of this current proposal. Note that the reason I have new / enhanced focus on simplicity is that this mechanism is probably our only way to resolve regressions like this: http://lore.kernel.org/d8d2c310-2021-431f-adbe-71ad0a17896a@xxxxxxx In other words, mainline is now failing to enumerate memory in more scenarios than it was previously. I do not want to be forcing Linus and the -stable team to to review wider changes to kernel/resource.c than is necessary. I.e. there is a chance this proposal needs to be seek a v6.13-rc consideration.