From: Dan Williams <dan.j.williams@intel.com>
To: Jim Harris <jim.harris@samsung.com>,
"linux-cxl@vger.kernel.org" <linux-cxl@vger.kernel.org>
Subject: RE: [PATCH] cxl: set root decoder granularity based on region params
Date: Wed, 4 Oct 2023 18:18:21 -0700 [thread overview]
Message-ID: <651e0eddb7f6c_ae7e72946c@dwillia2-xfh.jf.intel.com.notmuch> (raw)
In-Reply-To: <169646090522.666328.17608442776078591123.stgit@bgt-140510-bm03.eng.stellus.in>
Jim Harris wrote:
> The granularity for downstream targets is all based on descending the
> topology from the root. So we need to set the root decoder's granularity
> based on the region params.
>
> Test configuration is 1 host bridge * 2 switches * 2 endpoints per switch.
>
> Region created with 2048 granularity using following command line:
>
> cxl create-region -m -d decoder0.0 -w 4 mem0 mem2 mem1 mem3 \
> -g 2048 -s 2048M
>
> Use "cxl list -PDE | grep granularity" to get a view of the granularity
> set at each level of the topology.
>
> Before:
> "interleave_granularity":2048,
> "interleave_granularity":2048,
> "interleave_granularity":512,
> "interleave_granularity":2048,
> "interleave_granularity":2048,
> "interleave_granularity":512,
> "interleave_granularity":256,
>
> After:
> "interleave_granularity":2048,
> "interleave_granularity":2048,
> "interleave_granularity":4096,
> "interleave_granularity":2048,
> "interleave_granularity":2048,
> "interleave_granularity":4096,
> "interleave_granularity":2048,
>
> Signed-off-by: Jim Harris <jim.harris@samsung.com>
> ---
> drivers/cxl/core/region.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c
> index 6d63b8798c29..f14110e35f79 100644
> --- a/drivers/cxl/core/region.c
> +++ b/drivers/cxl/core/region.c
> @@ -1691,6 +1691,11 @@ static int cxl_region_attach(struct cxl_region *cxlr,
> return -EINVAL;
> }
>
> + /* Set root decoder's granularity now, so that we can use it to calculate
> + * granularity for the downstream targets in cxl_region_setup_targets().
> + */
Minor, and I mean minor, nit, the cxl subsystem is using:
/*
* Comment...
*/
...block-comment style. Yes, it varies across subsystems, yes it's
arbitrary, but general rule is follow local customs.
> + cxlrd->cxlsd.cxld.interleave_granularity = cxlr->params.interleave_granularity;
> +
So I think this is only valid in the cxlrd->cxlsd.cxld.interleave_ways == 1
case as interleave_granularity_store() forbids regions that do not match
the granularity of the root.
If a BIOS tries to ship such a config in production that's when I expect
that policy needs to be revisited, but outside of being forced to
reconsider that stance the complexity reduction is the benefit.
In the meantime maybe add an "effective granularity" concept for x1 root
decoders and x1 switches so the math can use that value?
next prev parent reply other threads:[~2023-10-05 1:18 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20231004230826uscas1p2f7957bf868a609211271e30ad8ff551f@uscas1p2.samsung.com>
2023-10-04 23:08 ` [PATCH] cxl: set root decoder granularity based on region params Jim Harris
2023-10-05 1:18 ` Dan Williams [this message]
2023-10-05 16:52 ` Jim Harris
2023-10-05 18:08 ` Dan Williams
2023-10-25 0:55 ` Dan Williams
2023-10-25 1:33 ` Jim Harris
2023-10-25 1:58 ` Dan Williams
2023-10-06 16:21 ` [PATCH] cxl/region: use region (not root decoder) granularity for calculations Jim Harris
2023-10-25 2:11 ` Dan Williams
2023-10-25 15:48 ` Jim Harris
2023-10-25 15:48 ` [PATCH v2] " Jim Harris
2023-10-26 0:11 ` Dan Williams
2023-10-26 17:11 ` Dan Williams
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=651e0eddb7f6c_ae7e72946c@dwillia2-xfh.jf.intel.com.notmuch \
--to=dan.j.williams@intel.com \
--cc=jim.harris@samsung.com \
--cc=linux-cxl@vger.kernel.org \
/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