Thread (120 messages) 120 messages, 8 authors, 2024-09-09

Re: [PATCH v3 18/25] cxl/extent: Process DCD events and realize region extents

From: Fan Ni <hidden>
Date: 2024-08-27 16:02:41
Also in: linux-btrfs, linux-cxl, lkml, nvdimm

On Tue, Aug 27, 2024 at 01:08:29PM +0100, Jonathan Cameron wrote:
On Fri, 23 Aug 2024 14:32:32 -0700
Fan Ni [off-list ref] wrote:
quoted
On Fri, Aug 16, 2024 at 09:44:26AM -0500, ira.weiny@intel.com wrote:
quoted
From: Navneet Singh <redacted>

A dynamic capacity device (DCD) sends events to signal the host for
changes in the availability of Dynamic Capacity (DC) memory.  These
events contain extents describing a DPA range and meta data for memory
to be added or removed.  Events may be sent from the device at any time.

Three types of events can be signaled, Add, Release, and Force Release.

On add, the host may accept or reject the memory being offered.  If no
region exists, or the extent is invalid, the extent should be rejected.
Add extent events may be grouped by a 'more' bit which indicates those
extents should be processed as a group.

On remove, the host can delay the response until the host is safely not
using the memory.  If no region exists the release can be sent
immediately.  The host may also release extents (or partial extents) at
any time.  Thus the 'more' bit grouping of release events is of less
value and can be ignored in favor of sending multiple release capacity
responses for groups of release events.

Force removal is intended as a mechanism between the FM and the device
and intended only when the host is unresponsive, out of sync, or
otherwise broken.  Purposely ignore force removal events.

Regions are made up of one or more devices which may be surfacing memory
to the host.  Once all devices in a region have surfaced an extent the
region can expose a corresponding extent for the user to consume.
Without interleaving a device extent forms a 1:1 relationship with the
region extent.  Immediately surface a region extent upon getting a
device extent.

Per the specification the device is allowed to offer or remove extents
at any time.  However, anticipated use cases can expect extents to be
offered, accepted, and removed in well defined chunks.

Simplify extent tracking with the following restrictions.

	1) Flag for removal any extent which overlaps a requested
	   release range.
	2) Refuse the offer of extents which overlap already accepted
	   memory ranges.
	3) Accept again a range which has already been accepted by the
	   host.  (It is likely the device has an error because it
	   should already know that this range was accepted.  But from
	   the host point of view it is safe to acknowledge that
	   acceptance again.)

Management of the region extent devices must be synchronized with
potential uses of the memory within the DAX layer.  Create region extent
devices as children of the cxl_dax_region device such that the DAX
region driver can co-drive them and synchronize with the DAX layer.
Synchronization and management is handled in a subsequent patch.

Process DCD events and create region devices.

Signed-off-by: Navneet Singh <redacted>
Co-developed-by: Ira Weiny <redacted>
Signed-off-by: Ira Weiny <redacted>
  
One minor change inline.
Hi Fan,

Crop please.  I scanned past it 3 times when scrolling without noticing
what you'd actually commented on.
Sure. I will crop in the future.
Thanks for the tips, Jonathan.

Fan
quoted
quoted
+/* See CXL 3.0 8.2.9.2.1.5 */  
Update the reference to reflect CXL 3.1.

Fan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help