public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Anisa Su <anisa.su887@gmail.com>
To: John Groves <john@jagalactic.com>, Gregory Price <gourry@gourry.net>
Cc: Davidlohr Bueso <dave@stgolabs.net>,
	Jonathan Cameron <jic23@kernel.org>,
	Dave Jiang <dave.jiang@intel.com>,
	Alison Schofield <alison.schofield@intel.com>,
	Vishal Verma <vishal.l.verma@intel.com>,
	Ira Weiny <ira.weiny@intel.com>, Dan Williams <djbw@kernel.org>,
	John Groves <John@groves.net>, Shiju Jose <shiju.jose@huawei.com>,
	Robert Richter <rrichter@amd.com>,
	"linux-cxl@vger.kernel.org" <linux-cxl@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"dev.srinivasulu@gmail.com" <dev.srinivasulu@gmail.com>,
	"arramesh@micron.com" <arramesh@micron.com>,
	"ajayjoshi@micron.com" <ajayjoshi@micron.com>
Subject: Re: [RFC PATCH 0/4] cxl/extent: Enable and validate multi-extent DCDs
Date: Fri, 1 May 2026 15:00:07 -0700	[thread overview]
Message-ID: <afUiZ27UtF3589IR@4470NRD-ASU.ssi.samsung.com> (raw)
In-Reply-To: <0100019dbcc13648-596853f3-0083-46e0-b654-396eedd657cb-000000@email.amazonses.com>

On Thu, Apr 23, 2026 at 11:51:12PM +0000, John Groves wrote:
> From: John Groves <john@groves.net>
> 
> 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@Groves.net>
> 
> 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
> 
> 

  parent reply	other threads:[~2026-05-01 22:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260423235108.3732424-1-john@jagalactic.com>
2026-04-23 23:51 ` [RFC PATCH 0/4] cxl/extent: Enable and validate multi-extent DCDs John Groves
2026-04-23 23:52   ` [RFC PATCH 1/4] cxl/extent: Promote cxlr_dax->region_extent to an xarray John Groves
2026-04-24  0:51     ` Dave Jiang
2026-04-24 22:01     ` Ira Weiny
2026-04-27 12:38       ` Jonathan Cameron
2026-04-27 15:12         ` Ira Weiny
2026-04-29 10:56           ` Jonathan Cameron
2026-05-01 10:56             ` Gregory Price
2026-04-27 18:32       ` Anisa Su
2026-04-23 23:52   ` [RFC PATCH 2/4] cxl/extent: Fix DCD add-capacity: per-tag assembly, ordering, and integrity John Groves
2026-04-23 23:52   ` [RFC PATCH 3/4] cxl/extent: Support extents in sharable CDAT regions John Groves
2026-04-23 23:52   ` [RFC PATCH 4/4] cxl/extent: Reject tagged extents that span DC partitions John Groves
2026-04-24  6:34   ` [RFC PATCH 0/4] cxl/extent: Enable and validate multi-extent DCDs Anisa Su
2026-05-01 22:00   ` Anisa Su [this message]
2026-05-02 10:48     ` Gregory Price

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=afUiZ27UtF3589IR@4470NRD-ASU.ssi.samsung.com \
    --to=anisa.su887@gmail.com \
    --cc=John@groves.net \
    --cc=ajayjoshi@micron.com \
    --cc=alison.schofield@intel.com \
    --cc=arramesh@micron.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=dev.srinivasulu@gmail.com \
    --cc=djbw@kernel.org \
    --cc=gourry@gourry.net \
    --cc=ira.weiny@intel.com \
    --cc=jic23@kernel.org \
    --cc=john@jagalactic.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rrichter@amd.com \
    --cc=shiju.jose@huawei.com \
    --cc=vishal.l.verma@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox