Re: [RFC PATCH 0/4] cxl/extent: Enable and validate multi-extent DCDs
From: Anisa Su
Date: Fri May 01 2026 - 18:00:28 EST
On Thu, Apr 23, 2026 at 11:51:12PM +0000, John Groves wrote:
> From: John Groves <john@xxxxxxxxxx>
>
> This series fixes correctness issues in the DCD (Dynamic Capacity
> Device) add-capacity pipeline so that multi-tag allocations, sharable
> CDAT regions, and cross-partition checks work end-to-end.
>
[snip]
Hi John,
I've already squashed your branches to a GH branch so they're just hanging out
until we get some more feedback.
But I do have some food for thought relating to the DAX layer changes that would
be required to make this patchset function the way it's intended:
Currently DAX device creation is not tag-aware. This patchset only affects the
conditions of when we choose to accept/reject extents. But accepted extents just
hang out under the region until a DAX device is created and
claims resources on the region.
Currently, doing daxctl create-device on a dynamic_ram_a type region does 2
things:
daxctl create-device -r region0 -s requested_size
1. create a 0-sized dev_dax seed:
- create_store()
- extents must have been added to the region already, otherwise returns
-ENOSPC
avail = dax_region_avail_size(dax_region);
if (avail == 0)
rc = -ENOSPC;
- creates a 0-sized DAX device seed (Sparse DAX region devices must be
created initially with 0 size)
2. resize the empty dev_dax to requested_size or the size of the region if -s
not specified
- size_store(to_alloc = requested_size ? requested_size :
dax_region_avail_size(dax_region))
- dev_dax_resize()
- iterates over each child resource of the region to find unused
resources and claims them up to min(available_size, to_alloc)
- for sparse regions, each child resource = 1 region extent
- *note*: in Ira's original patchset, each region_extent = 1
device extent.
Thus each resource under the resource tree of the dax_region
corresponds to 1 device extent
- In the current version: 1 region_extent --> 1 tagged
allocation (1+ extents w/the same tag)
- this should also be cleared up
If we want each DAX device to correspond to a specific tag (tag-aware DAX device
creation):
1. Add tag to struct dax_resource
/**
* struct dax_resource - For sparse regions; an active resource
* @region: dax_region this resources is in
* @res: resource
* @use_cnt: count the number of uses of this resource
*
* Changes to the dax_region and the dax_resources within it are protected by
* dax_region_rwsem
*
* dax_resource's are not intended to be used outside the dax layer.
*/
struct dax_resource {
struct dax_region *region;
struct resource *res;
unsigned int use_cnt;
+ uuid_t tag;
};
2. In the resizing operation:
- only allow dax device to claim a resource if it has the right tag
- all resources with that tag must be claimed by that device
- currently, the logic allows for a DAX device partially claim an extent
if requested_size_to_alloc < size_of_free_extent(s); would need to be
disallowed for tagged extents
3. ? New sysfs interface to allow for something like "echo [tag_abcd] >
/sys/.../daxX.Y/tag"
4. If we allow non-tagged extents (as this patchset allows):
- can non-tagged extents be partially claimed by a DAX device that
doesn't have a specified tag?
Ira's original patchset introduced minimal changes to DAX logic. Introducing
tag-awareness to
DAX resize logic may require adding more conditional statements,
especially if we allow both NULL and non-NULL tags (but there might be a nice
way to do it;
This is just my initial impression, I haven't tried implementing it, and I could
certainly look into it more)
TLDR; some topics for discussion:
1. region_extent to device extent relationship
- Ira said w/o interleaving, it should remain 1:1, not 1:many for
grouping device extents by tag
2. tag-aware DAX device creation
- changes needed & their implications
- what to do with non-tagged extents
See you at LSFMM :)
Thanks,
Anisa
> Signed-off-by: John Groves <John@xxxxxxxxxx>
>
> John Groves (4):
> cxl/extent: Promote cxlr_dax->region_extent to an xarray
> cxl/extent: Fix DCD add-capacity: per-tag assembly, ordering, and
> integrity
> cxl/extent: Support extents in sharable CDAT regions
> cxl/extent: Reject tagged extents that span DC partitions
>
> drivers/cxl/core/extent.c | 93 +++---
> drivers/cxl/core/mbox.c | 628 +++++++++++++++++++++++++++++++-------
> drivers/cxl/core/region.c | 2 +
> drivers/cxl/cxl.h | 9 +-
> include/cxl/event.h | 1 -
> 5 files changed, 584 insertions(+), 149 deletions(-)
>
> --
> 2.53.0
>
>