Linux CXL
 help / color / mirror / Atom feed
From: Alison Schofield <alison.schofield@intel.com>
To: Li Ming <ming.li@zohomail.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>,
	Jonathan Cameron <jic23@kernel.org>,
	Dave Jiang <dave.jiang@intel.com>,
	Vishal Verma <vishal.l.verma@intel.com>,
	Ira Weiny <iweiny@kernel.org>, Richard Cheng <icheng@nvidia.com>,
	<linux-cxl@vger.kernel.org>
Subject: Re: [PATCH 3/4] cxl/region: Consolidate region performance completion
Date: Fri, 6 Nov 2026 10:25:14 -0800	[thread overview]
Message-ID: <au4birbdt2RaGrMo@aschofie-mobl2.lan> (raw)
In-Reply-To: <51d3903c-c822-4bdb-9615-5f8d8b0ae3b3@zohomail.com>

On Fri, Nov 06, 2026 at 02:15:47PM +0800, Li Ming wrote:
> 
> 在 2026/11/5 11:28, Alison Schofield 写道:
> > Both user-created and autodiscovered regions perform the same three
> > operations when all targets are attached: calculate performance data,
> > account for shared upstream bandwidth, and update the visibility of the
> > region access attributes.
> > 
> > Consolidate these operations in cxl_region_perf_data_complete() to keep
> > the completion paths consistent and preserve their ordering.
> > 
> > No functional change.
> > 
> > Signed-off-by: Alison Schofield <alison.schofield@intel.com>
> > ---
> >   drivers/cxl/core/region.c | 15 +++++++++------
> >   1 file changed, 9 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
> > index 50cd483d710d..f9435e65c695 100644
> > --- a/drivers/cxl/core/region.c
> > +++ b/drivers/cxl/core/region.c
> > @@ -157,6 +157,13 @@ static void cxl_region_update_access_groups(struct cxl_region *cxlr)
> >   		dev_dbg(&cxlr->dev, "Failed to update access1 group\n");
> >   }
> > +static void cxl_region_perf_data_complete(struct cxl_region *cxlr)
> > +{
> > +	cxl_region_perf_data_update(cxlr);
> > +	cxl_region_shared_upstream_bandwidth_update(cxlr);
> > +	cxl_region_update_access_groups(cxlr);
> > +}
> > +
> >   static ssize_t uuid_show(struct device *dev, struct device_attribute *attr,
> >   			 char *buf)
> >   {
> > @@ -2182,9 +2189,7 @@ static int cxl_region_attach(struct cxl_region *cxlr,
> >   		 * then the region is already committed.
> >   		 */
> >   		p->state = CXL_CONFIG_COMMIT;
> > -		cxl_region_perf_data_update(cxlr);
> > -		cxl_region_shared_upstream_bandwidth_update(cxlr);
> > -		cxl_region_update_access_groups(cxlr);
> > +		cxl_region_perf_data_complete(cxlr);
> >   		return 0;
> >   	}
> > @@ -2206,9 +2211,7 @@ static int cxl_region_attach(struct cxl_region *cxlr,
> >   		if (rc)
> >   			return rc;
> >   		p->state = CXL_CONFIG_ACTIVE;
> > -		cxl_region_perf_data_update(cxlr);
> > -		cxl_region_shared_upstream_bandwidth_update(cxlr);
> > -		cxl_region_update_access_groups(cxlr);
> > +		cxl_region_perf_data_complete(cxlr);
> >   	}
> Is it possible to call cxl_region_perf_data_complete() inside
> cxl_region_setup_targets()? So that we don't need to call it separately for
> user-created and autodiscovered regions.

Thanks for the reviews and feedback Ming -

That would work, yet I prefer to keep the two calls explicit. That makes
it clear when the region has reached its completed state and perf data is
finalized.

Note that cxl_region_setup_targets() configures port decoder targets, while
cxl_region_perf_data_complete() handles performance data and sysfs visiblity.
I think those operations are better kept separate.

-- Alison


> >   	cxled->cxld.interleave_ways = p->interleave_ways;

  reply	other threads:[~2026-11-06 18:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-05  3:28 [PATCH 0/4] cxl/region: Update and test performance calculations Alison Schofield
2026-11-05  3:28 ` [PATCH 1/4] cxl/region: Calculate performance data once all targets are attached Alison Schofield
2026-11-06  5:51   ` Li Ming
2026-11-05  3:28 ` [PATCH 2/4] cxl/region: Show access attributes once performance data is calculated Alison Schofield
2026-11-06  6:11   ` Li Ming
2026-11-05  3:28 ` [PATCH 3/4] cxl/region: Consolidate region performance completion Alison Schofield
2026-11-06  6:15   ` Li Ming
2026-11-06 18:25     ` Alison Schofield [this message]
2026-11-10 13:07   ` Li Ming
2026-11-05  3:28 ` [PATCH 4/4] cxl/test: Give each mock memdev its own performance data Alison Schofield
2026-11-06  6:16   ` Li Ming
2026-11-10 18:31 ` [PATCH 0/4] cxl/region: Update and test performance calculations Dave Jiang

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=au4birbdt2RaGrMo@aschofie-mobl2.lan \
    --to=alison.schofield@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dave@stgolabs.net \
    --cc=icheng@nvidia.com \
    --cc=iweiny@kernel.org \
    --cc=jic23@kernel.org \
    --cc=linux-cxl@vger.kernel.org \
    --cc=ming.li@zohomail.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