Re: [PATCH v1 14/14] Documentation/cxl: Document DCD extent handling

From: Alison Schofield

Date: Mon Nov 30 2026 - 17:59:44 EST


On Thu, Nov 05, 2026 at 08:02:38AM +0900, Anisa Su wrote:
> Add a "Dynamic Capacity Extents" section to cxl-driver.rst, describing
> when CXL core accepts an offered extent and when a release request
> is acknowledged.
>
> Update maturity-map.rst to reflect initial support for "Extent add /
> release event handling". Overall DCD Support stays at [0] until the
> DAX layer plumbing lands and extents become usable.
>
> Signed-off-by: Anisa Su <anisa.su@xxxxxxxxxxx>
> ---
> .../driver-api/cxl/linux/cxl-driver.rst | 181 ++++++++++++++++++
> Documentation/driver-api/cxl/maturity-map.rst | 2 +-
> 2 files changed, 182 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/driver-api/cxl/linux/cxl-driver.rst b/Documentation/driver-api/cxl/linux/cxl-driver.rst
> index 212df4fb8d63..28f6c0530c8a 100644
> --- a/Documentation/driver-api/cxl/linux/cxl-driver.rst
> +++ b/Documentation/driver-api/cxl/linux/cxl-driver.rst
> @@ -654,6 +654,187 @@ from HPA to DPA. This is why they must be aware of the entire interleave set.
> Linux does not support unbalanced interleave configurations. As a result, all
> endpoints in an interleave set must have the same ways and granularity.
>
> +Dynamic Capacity Extents
> +========================
> +
> +A `Dynamic Capacity Device (DCD)` advertises capacity in `DC Regions`
> +and surfaces individual chunks of that capacity to the host as
> +`extents` (CXL r4.0 Section 9.13.3 "Dynamic Capacity Device (DCD)").
> +Linux calls a DC Region a `DC partition` (see "DPA Partitions" above)
> +so that "region" keeps its software meaning: a :code:`cxl_region` is
> +the host-side object that maps DPA into a host physical address range,
> +whereas a DC Region is a device-defined slice of DPA space.
> +
> +Accepting Extents
> +-----------------
> +Extents are made available to the host through DC Add events: the
> +device sends one or more Dynamic Capacity Event Records (CXL r4.0
> +Section 8.2.10.2.1.6, Table 8-229) to the host. Each record carries
> +one extent, which the host may accept or reject. A device offering
> +several extents sends one record per extent, chained with `More`: each
> +record has the `More` flag set to announce another incoming record,
> +until the last record, which carries `More=0` to mark the end of the
> +chain.
> +
> +For each record received, the host stages the offered extent on a
> +pending list. When the chain closes the host knows that every extent
> +of this add event has arrived, and the whole pending list is validated
> +before anything is accepted. A chain whose closing record does not


The code validates and onlines one tag group at a time. Only the Add
response waits for the whole list. Should the doc say that?


> +arrive within 20 seconds is refused as a whole: the watchdog answers
> +with an empty Add Dynamic Capacity Response so the device can reclaim
> +the offer, and the staged extents are discarded.
> +
> +From the pending list, extents that share a (non-null) tag are
> +extracted into a tag group so that each group can be validated as a
> +unit; a group that is accepted becomes a :code:`struct
> +cxl_dc_tag_group`. A tag group is one logical allocation. An untagged
> +extent is an allocation of its own and becomes a single-member group.
> +
> +Group-level validation (:code:`cxl_validate_group()`,
> +:code:`drivers/cxl/core/mbox.c`) drops the whole group if any check
> +fails:
> +
> +* `Host-wide tag uniqueness`: a non-null tag must not already
> + correspond to a live :code:`cxl_dc_tag_group` anywhere on this host.
> + The orchestrator / Fabric Manager owns tag assignment (CXL r4.0
> + Section 9.13.3.1 "DCD Management by FM" and Section 7.6.7.6 "DCD
> + Management Command Set for LD-FAM"); the list in
> + :code:`drivers/cxl/core/extent.c` (:code:`cxl_tag_register()` /
> + :code:`cxl_tag_already_committed()`) catches firmware bugs and


The section names a lot of static helpers and file paths that can go
stale. The rules themselves stay valid. Maybe describe the rules and
keep only the user-visible names, such as tag_groupX.Y, extentX.Y and
untagged?


snip
> +* The extent's DPA range must lie within a DC partition of the memdev
> + (:code:`cxl_extent_dc_partition()`). On a sharable partition the
> + extent must carry a tag; on a non-sharable one its shared extent
> + sequence must be 0.
> +* The extent's DPA range must resolve to a CXL region via
> + :code:`cxl_dpa_to_region()`. An extent with no owning region is
> + dropped, as is one whose :code:`dax_region` has not finished its
> + probe-time scan or has no driver bound (see Recovery below).


There isn't a 'Recovery' section.


snip
> +Releasing Extents
> +-----------------
> +
> +A release may be initiated by the device (a Release Capacity event) or
> +by the host, for example when tearing down a region. A host may also
> +issue a Release Dynamic Capacity Response not associated with any
> +event, an "unsolicited release", at any time (CXL r4.0 Section 9.13.3).


The spec calls opcode 4803h "Release Dynamic Capacity" (8.2.10.9.9.4).
This section says "Release Dynamic Capacity Response" four times.
Suggest using the spec name.


> +The host-initiated path runs :code:`dc_tag_group_teardown()` for each
> +tag group of the region: it invalidates the region's cached lines,
> +returns the group with its own Release Dynamic Capacity Response and
> +unregisters its extents. The device-initiated path goes through the
> +release chain in :code:`drivers/cxl/core/mbox.c`.


This says teardown always invalidates, but teardown releases even when
the invalidation fails (raised on patch 6), while the device-initiated
path below keeps the group when it fails (patch 11). Whichever policy
is chosen, update the doc to state it for both paths.

snip

> +
> +* The extent is resolved by :code:`cxl_resolve_extent()` to its CXL
> + region and :code:`cxl_dc_tag_group`.
> +* An extent the host does not own is acknowledged so the device knows
> + the host is not using it: its DPA range resolves to no region, to a
> + region whose :code:`cxlr_dax` is not set up, or to a range that
> + overlaps nothing the host owns (for example, an extent left over
> + from a host crash that has not yet been re-claimed, or a duplicate


s/re-claimed/reclaimed