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

Jonathan Cameron
2024-08-27T12:08:33Z

On Fri, 23 Aug 2024 14:32:32 -0700
Fan Ni <nifan.cxl@gmail.com> wrote:

> On Fri, Aug 16, 2024 at 09:44:26AM -0500, ira.weiny@intel.com wrote:
> > From: Navneet Singh <navneet.singh@intel.com>
> >
> > 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 <navneet.singh@intel.com>
> > Co-developed-by: Ira Weiny <ira.weiny@intel.com>
> > Signed-off-by: Ira Weiny <ira.weiny@intel.com>
> >
>
> One minor change inline.
Hi Fan,

Crop please. I scanned past it 3 times when scrolling without noticing
what you'd actually commented on.

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