You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dax/region: Create resources on sparse DAX regions
DAX regions which map dynamic capacity partitions require that memory be
allowed to come and go. Recall sparse regions were created for this
purpose. Now that extents can be realized within DAX regions the DAX
region driver can start tracking sub-resource information.
The tight relationship between DAX region operations and extent
operations require memory changes to be controlled synchronously with
the user of the region. Synchronize through the dax_region_rwsem and by
having the region driver drive both the region device as well as the
extent sub-devices.
Recall requests to remove extents can happen at any time and that a host
is not obligated to release the memory until it is not being used. If
an extent is not used allow a release response.
When extents are eligible for release. No mappings exist but data may
reside in caches not yet written to the device. Call
cxl_region_invalidate_memregion() to write back data to the device prior
to signaling the release complete.
Speculative writes after a release may dirty the cache such that a read
from a newly surfaced extent may not come from the device. Call
cxl_region_invalidate_memregion() prior to bringing a new extent online
to ensure the cache is marked invalid.
While these invalidate calls are inefficient they are the best we can do
to ensure cache consistency without back invalidate. Furthermore this
should occur infrequently with sufficiently large extents that real work
loads should not be impacted much.
The DAX layer has no need for the details of the CXL memory extent
devices. Expose extents to the DAX layer as device children of the DAX
region device. A single callback from the driver aids the DAX layer to
determine if the child device is an extent. The DAX layer also
registers a devres function to automatically clean up when the device is
removed from the region.
There is a race between extents being surfaced and the dax_cxl driver
being loaded. Synchronizes the driver during probe by scanning for
existing extents while under the device lock.
Respond to extent notifications. Manage the DAX region resource tree
based on the extents lifetime. Return the status of remove
notifications to lower layers such that it can manage the hardware
appropriately.
Based on an original patch by Navneet Singh.
Reviewed-by: Jonathan Cameron <[email protected]>
Signed-off-by: Ira Weiny <[email protected]>
---
Changes:
[iweiny: convert range prints to %pra]
0 commit comments