From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: Amit Singh Tomar <amitsinght@marvell.com>
Cc: <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>, <fenghua.yu@intel.com>,
<reinette.chatre@intel.com>, <james.morse@arm.com>,
<gcherian@marvell.com>, <robh@kernel.org>,
<peternewman@google.com>
Subject: Re: [RFC 01/12] arm_mpam: Handle resource instances mapped to different controls
Date: Fri, 1 Sep 2023 13:39:05 +0100 [thread overview]
Message-ID: <20230901133905.00000c14@Huawei.com> (raw)
In-Reply-To: <20230815152712.1760046-2-amitsinght@marvell.com>
On Tue, 15 Aug 2023 20:57:01 +0530
Amit Singh Tomar <amitsinght@marvell.com> wrote:
Hi Amit,
My comments are likely to be fairly superficial, at least partly because
we haven't yet had a good opportunity for a review of James' MPAM series
on top of which this sits. (side note that I'm keen that James posts
that so we can have at it properly)
Note James has a new version of the tree out so applying this was
a little messy.
> At the moment, configuring multiple resource instances (mapped to same
> control) under a resource class is not supported. For instance, on MARVELL
> SoC MPAMF_IDR_NS[RIS_MAX] (under LLC MSC) is 0x2, and there are three
> different resource at index 0,1,2. These are enumerated in
> TAD_CMN_MPAM_RIS_E:
>
> 0: MSC
> 1: LTG
> 2: DTG
Sometimes I think the MPAM spec is just too flexible. We are going to see
an awful lot of corner cases.
>
> LLC MSC resource at index 1, and 2 have cache portion partitioning
> feature, i.e., If MPAMCFG_PART_SEL_NS[RIS] is set to 1 (LTG) or to 2 (DTG),
> then MPAMF_IDR_NS[HAS_CPOR_PART] is set to 1. LTG resource has 16
> portion bitmap, and DTG has 18 portion bitmap (mapped to same
> CPOR control), and only one can be configured.
This patch description seems to first describe a clash between LTG and DTG
before going on to what the patch actually changes.
Do we need that initial description or can it be simplified
to just talk about...
>
> LLC MSC resource at index 0 has the Priority partitioning features.
> If MPAMCFG_PART_SEL_NS[RIS] is set to 0 (MSC), then MPAMF_IDR_NS[HAS_PRI_PART]
> is set to 1, leaving HAS_CPOR_PART bit to 0. CPOR and PRI_PART are
> mutually exclusive resources as far configuration is concerned.
>
> With this change, multiple resource instances that maps to different
> control, say LTG for CPOR, and MSC for PRI_PART is handled properly.
this second part?
>
> Signed-off-by: Amit Singh Tomar <amitsinght@marvell.com>
> ---
> drivers/platform/mpam/mpam_devices.c | 24 +++++++++++++++++++++++-
> 1 file changed, 23 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/platform/mpam/mpam_devices.c b/drivers/platform/mpam/mpam_devices.c
> index 589ff1ef2b6b..137cbff925ba 100644
> --- a/drivers/platform/mpam/mpam_devices.c
> +++ b/drivers/platform/mpam/mpam_devices.c
> @@ -1829,6 +1829,19 @@ static void mpam_enable_init_class_features(struct mpam_class *class)
> class->props = ris->props;
> }
>
> +/* Club different resource properties under a class that resctrl uses,
> + * for instance, L3 cache that supports both CPOR, and DSPRI need to have
> + * knowledge of both cpbm_wd and dspri_wd.
Perhaps highlight that this case only matters if the two properties
are under different RIS. I'm fairly sure that a valid implementation would
export both CPOR and DSPRI on the same RIS.
> + */
> +static void mpam_enable_club_class_features(struct mpam_class *class,
> + struct mpam_msc_ris *ris)
> +{
> + class->props.features |= ris->props.features;
> + class->props.cpbm_wd |= ris->props.cpbm_wd;
> + class->props.dspri_wd |= ris->props.dspri_wd;
> + class->props.num_csu_mon |= ris->props.num_csu_mon;
> +}
> +
> /* Merge all the common resource features into class. */
> static void mpam_enable_merge_features(void)
> {
> @@ -1843,7 +1856,16 @@ static void mpam_enable_merge_features(void)
>
> list_for_each_entry(comp, &class->components, class_list) {
> list_for_each_entry(ris, &comp->ris, comp_list) {
> - __resource_props_mismatch(ris, class);
> + /* There can be multiple resources under a class which is
> + * mapped to different controls, for instance L3 cache
> + * can have both CPOR and DSPRI implemented, and following
implemented with different RIS
> + * would avoid property mismatch later on when different
> + * resources are present.
> + */
> + if (class->props.features != ris->props.features)
> + mpam_enable_club_class_features(class, ris);
I think the __resource_props_mismatch still needs calling. Consider
a pair or RIS A and B
A supports CPOR only with 12 partitions.
B supports CPOR with 10 partitions and DSPRI
This will expand the set to include both CPOR and DSPRI but
fail to catch the mismatch in partitions.
I'll hack some tests on top of my QEMU code to see if this works as
I think it does.
Jonathn
> + else
> + __resource_props_mismatch(ris, class);
>
> class->nrdy_usec = max(class->nrdy_usec,
> ris->msc->nrdy_usec);
next prev parent reply other threads:[~2023-09-01 12:39 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-15 15:27 [RFC 00/12] ARM: MPAM: add support for priority partitioning control Amit Singh Tomar
2023-08-15 15:27 ` [RFC 01/12] arm_mpam: Handle resource instances mapped to different controls Amit Singh Tomar
2023-09-01 12:39 ` Jonathan Cameron [this message]
2023-08-15 15:27 ` [RFC 02/12] arm_mpam: resctrl: Detect priority partitioning capability Amit Singh Tomar
2023-09-01 12:30 ` Jonathan Cameron
2023-08-15 15:27 ` [RFC 03/12] arm_mpam: resctrl: Define new schemata format for priority partition Amit Singh Tomar
2023-08-15 15:27 ` [RFC 04/12] fs/resctrl: Obtain CPBM upon priority partition presence Amit Singh Tomar
2023-08-15 15:27 ` [RFC 05/12] fs/resctrl: Set-up downstream priority partition resources Amit Singh Tomar
2023-08-17 17:39 ` Fenghua Yu
2023-08-15 15:27 ` [RFC 06/12] fs/resctrl: Extend schemata read for priority partition control Amit Singh Tomar
2023-08-17 17:42 ` Fenghua Yu
2023-08-15 15:27 ` [RFC 07/12] arm_mpam: resctrl: Retrieve priority values from arch code Amit Singh Tomar
2023-08-15 15:27 ` [RFC 08/12] fs/resctrl: Schemata write only for intended resource Amit Singh Tomar
2023-08-15 15:27 ` [RFC 09/12] fs/resctrl: Extend schemata write for priority partition control Amit Singh Tomar
2023-08-17 17:27 ` Fenghua Yu
2023-08-17 17:53 ` Fenghua Yu
2023-08-15 15:27 ` [RFC 10/12] arm_mpam: resctrl: Facilitate writing downstream priority value Amit Singh Tomar
2023-08-15 15:27 ` [RFC 11/12] arm_mpam: Fix Downstream priority mask Amit Singh Tomar
2023-09-01 13:32 ` Jonathan Cameron
2023-08-15 15:27 ` [RFC 12/12] arm_mpam: Program Downstream priority value Amit Singh Tomar
2023-09-01 13:17 ` Jonathan Cameron
2023-08-17 19:11 ` [RFC 00/12] ARM: MPAM: add support for priority partitioning control Reinette Chatre
2023-08-17 20:29 ` Reinette Chatre
2023-08-22 12:44 ` [EXT] " Amit Singh Tomar
2023-08-23 19:06 ` Reinette Chatre
2023-08-23 21:33 ` Amit Singh Tomar
2023-08-23 22:20 ` Reinette Chatre
2023-08-23 22:36 ` Luck, Tony
2023-08-24 8:52 ` Amit Singh Tomar
2023-08-24 15:30 ` Luck, Tony
2023-08-24 18:00 ` Reinette Chatre
2024-01-11 20:56 ` Peter Newman
2024-01-11 21:40 ` Tony Luck
2024-01-11 22:01 ` Reinette Chatre
2024-01-11 23:14 ` Luck, Tony
2024-01-11 23:31 ` Reinette Chatre
2023-08-22 9:01 ` Peter Newman
2023-09-01 14:42 ` Jonathan Cameron
2023-09-01 15:04 ` Jonathan Cameron
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=20230901133905.00000c14@Huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=amitsinght@marvell.com \
--cc=fenghua.yu@intel.com \
--cc=gcherian@marvell.com \
--cc=james.morse@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peternewman@google.com \
--cc=reinette.chatre@intel.com \
--cc=robh@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