From: Fenghua Yu <fenghua.yu@intel.com>
To: Amit Singh Tomar <amitsinght@marvell.com>,
<linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>
Cc: <reinette.chatre@intel.com>, <james.morse@arm.com>,
<gcherian@marvell.com>, <robh@kernel.org>,
<peternewman@google.com>
Subject: Re: [RFC 05/12] fs/resctrl: Set-up downstream priority partition resources
Date: Thu, 17 Aug 2023 10:39:04 -0700 [thread overview]
Message-ID: <a254878e-1872-846f-bed3-3c857d7a73d7@intel.com> (raw)
In-Reply-To: <20230815152712.1760046-6-amitsinght@marvell.com>
Hi, Amit,
On 8/15/23 08:27, Amit Singh Tomar wrote:
> Upon resource control group creation, Cache portion bitmap, and Memory
> bandwidth allocation gets initialized to the default/maximum values,
> obtained from resource control code.
>
> Let's replicate it for priority partition resource, and setup the default
> downstream priority value.
>
> Signed-off-by: Amit Singh Tomar <amitsinght@marvell.com>
> ---
> drivers/platform/mpam/mpam_resctrl.c | 4 +++-
> fs/resctrl/rdtgroup.c | 30 ++++++++++++++++++++++++++++
> include/linux/resctrl.h | 4 ++++
> 3 files changed, 37 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/platform/mpam/mpam_resctrl.c b/drivers/platform/mpam/mpam_resctrl.c
> index 1081ceac41a8..cc843f1b0fb7 100644
> --- a/drivers/platform/mpam/mpam_resctrl.c
> +++ b/drivers/platform/mpam/mpam_resctrl.c
> @@ -733,8 +733,10 @@ static int mpam_resctrl_resource_init(struct mpam_resctrl_res *res)
> exposed_alloc_capable = true;
> }
>
> - if (has_ppart)
> + if (has_ppart) {
> r->priority_cap = true;
> + r->dspri_default_ctrl = BIT_MASK(class->props.dspri_wd) - 1;
> + }
>
> /*
> * MBWU counters may be 'local' or 'total' depending on where
> diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c
> index 9c5dfaaa7fa2..bc5fb246ba68 100644
> --- a/fs/resctrl/rdtgroup.c
> +++ b/fs/resctrl/rdtgroup.c
> @@ -3045,6 +3045,21 @@ static int rdtgroup_init_cat(struct resctrl_schema *s, u32 closid)
> return 0;
> }
>
> +static int rdtgroup_init_dspri(struct rdt_resource *r, u32 closid)
> +{
> + struct resctrl_staged_config *cfg;
> + struct rdt_domain *d;
> +
> + list_for_each_entry(d, &r->domains, list) {
> + cfg = &d->staged_config[CDP_NONE];
> + cfg->new_ctrl = r->dspri_default_ctrl;
> + cfg->have_new_ctrl = true;
> + r->dspri_store = true;
> + }
> +
> + return 0;
> +}
> +
> /* Initialize MBA resource with default values. */
> static void rdtgroup_init_mba(struct rdt_resource *r, u32 closid)
> {
> @@ -3082,12 +3097,27 @@ static int rdtgroup_init_alloc(struct rdtgroup *rdtgrp)
> return ret;
> }
>
> + if (r->priority_cap)
> + r->dspri_store = false;
> +
> ret = resctrl_arch_update_domains(r, rdtgrp->closid);
> if (ret < 0) {
> rdt_last_cmd_puts("Failed to initialize allocations\n");
> return ret;
> }
>
> + if (r->priority_cap) {
> + ret = rdtgroup_init_dspri(r, rdtgrp->closid);
> + if (ret < 0)
> + return ret;
> +
> + ret = resctrl_arch_update_domains(r, rdtgrp->closid);
> + if (ret < 0) {
> + rdt_last_cmd_puts("Failed to initialize allocations\n");
> + return ret;
> + }
> + r->dspri_store = false;
> + }
> }
>
> rdtgrp->mode = RDT_MODE_SHAREABLE;
> diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h
> index a98ba5828211..d5b0661c0f70 100644
> --- a/include/linux/resctrl.h
> +++ b/include/linux/resctrl.h
> @@ -198,6 +198,7 @@ struct resctrl_membw {
> * @alloc_capable: Is allocation available on this machine
> * @mon_capable: Is monitor feature available on this machine
> * @priority_capable: Is priority partitioning feature available on this machine
> + * @dspri_store:
Please add description for this new field.
> * @num_rmid: Number of RMIDs available
> * @cache_level: Which cache level defines scope of this resource
> * @cache: Cache allocation related data
> @@ -206,6 +207,7 @@ struct resctrl_membw {
> * @name: Name to use in "schemata" file.
> * @data_width: Character width of data when displaying
> * @default_ctrl: Specifies default cache cbm or memory B/W percent.
> + * @dspri_default_ctrl: Specifies default downstream priority value.
> * @format_str: Per resource format string to show domain value
> * @evt_list: List of monitoring events
> * @fflags: flags to choose base and info files
> @@ -216,6 +218,7 @@ struct rdt_resource {
> bool alloc_capable;
> bool mon_capable;
> bool priority_cap;
> + bool dspri_store;
> int num_rmid;
> int cache_level;
> struct resctrl_cache cache;
> @@ -224,6 +227,7 @@ struct rdt_resource {
> char *name;
> int data_width;
> u32 default_ctrl;
> + u32 dspri_default_ctrl;
> const char *format_str;
> struct list_head evt_list;
> unsigned long fflags;
Thanks.
-Fenghua
next prev parent reply other threads:[~2023-08-17 17: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
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 [this message]
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=a254878e-1872-846f-bed3-3c857d7a73d7@intel.com \
--to=fenghua.yu@intel.com \
--cc=amitsinght@marvell.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
all inboxes | Powered by JetHome®