From: Amit Singh Tomar <amitsinght@marvell.com>
To: <linux-kernel@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>
Cc: <fenghua.yu@intel.com>, <reinette.chatre@intel.com>,
<james.morse@arm.com>, <gcherian@marvell.com>, <robh@kernel.org>,
<peternewman@google.com>, <dfustini@baylibre.com>,
<jonathan.cameron@huawei.com>,
Amit Singh Tomar <amitsinght@marvell.com>
Subject: [PATCH v1 09/14] fs/resctrl: set configuration based on Control type
Date: Wed, 17 Jan 2024 19:44:00 +0530 [thread overview]
Message-ID: <20240117141405.3063506-10-amitsinght@marvell.com> (raw)
In-Reply-To: <20240117141405.3063506-1-amitsinght@marvell.com>
Now that, we have support for different control types, divided into
the BASIC and PRIORITY controls types. Schemata list is pertained to
the SCHEMAT_BASIC control type that is used to set up/configure
CAT (Cache Allocation Technology) and MBA (Memory Bandwidth Allocation)
capabilities, and SCHEMAT_DSPRI used to configure downstream priority
partitioning. Let's add boilerplate changes to set the control
configuration based on different control types.
Signed-off-by: Amit Singh Tomar <amitsinght@marvell.com>
---
Changes since RFC:
* No change, it's new patch.
---
arch/x86/kernel/cpu/resctrl/ctrlmondata.c | 6 ++++--
drivers/platform/mpam/mpam_resctrl.c | 9 ++++++---
fs/resctrl/ctrlmondata.c | 3 ++-
fs/resctrl/monitor.c | 3 ++-
fs/resctrl/rdtgroup.c | 3 ++-
include/linux/resctrl.h | 6 ++++--
6 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
index b34e86cfc111..4423d8979b5e 100644
--- a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
+++ b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
@@ -39,7 +39,8 @@ static bool apply_config(struct rdt_hw_domain *hw_dom,
}
int resctrl_arch_update_one(struct rdt_resource *r, struct rdt_domain *d,
- u32 closid, enum resctrl_conf_type t, u32 cfg_val)
+ u32 closid, enum resctrl_conf_type t, u32 cfg_val,
+ enum resctrl_ctrl_type type)
{
struct rdt_hw_resource *hw_res = resctrl_to_arch_res(r);
struct rdt_hw_domain *hw_dom = resctrl_to_arch_dom(d);
@@ -59,7 +60,8 @@ int resctrl_arch_update_one(struct rdt_resource *r, struct rdt_domain *d,
return 0;
}
-int resctrl_arch_update_domains(struct rdt_resource *r, u32 closid)
+int resctrl_arch_update_domains(struct rdt_resource *r, u32 closid,
+ enum resctrl_ctrl_type type)
{
struct resctrl_staged_config *cfg;
struct rdt_hw_domain *hw_dom;
diff --git a/drivers/platform/mpam/mpam_resctrl.c b/drivers/platform/mpam/mpam_resctrl.c
index 0de09e9deee5..7a797f9bcaed 100644
--- a/drivers/platform/mpam/mpam_resctrl.c
+++ b/drivers/platform/mpam/mpam_resctrl.c
@@ -920,7 +920,8 @@ u32 resctrl_arch_get_config(struct rdt_resource *r, struct rdt_domain *d,
}
int resctrl_arch_update_one(struct rdt_resource *r, struct rdt_domain *d,
- u32 closid, enum resctrl_conf_type t, u32 cfg_val)
+ u32 closid, enum resctrl_conf_type t, u32 cfg_val,
+ enum resctrl_ctrl_type type)
{
int err;
u32 partid;
@@ -983,7 +984,8 @@ int resctrl_arch_update_one(struct rdt_resource *r, struct rdt_domain *d,
}
/* TODO: this is IPI heavy */
-int resctrl_arch_update_domains(struct rdt_resource *r, u32 closid)
+int resctrl_arch_update_domains(struct rdt_resource *r, u32 closid,
+ enum resctrl_ctrl_type type)
{
int err = 0;
struct rdt_domain *d;
@@ -1000,7 +1002,8 @@ int resctrl_arch_update_domains(struct rdt_resource *r, u32 closid)
continue;
err = resctrl_arch_update_one(r, d, closid, t,
- cfg->new_ctrl);
+ cfg->new_ctrl,
+ type);
if (err)
return err;
}
diff --git a/fs/resctrl/ctrlmondata.c b/fs/resctrl/ctrlmondata.c
index f1f57bbfa094..005a91192847 100644
--- a/fs/resctrl/ctrlmondata.c
+++ b/fs/resctrl/ctrlmondata.c
@@ -405,7 +405,8 @@ ssize_t rdtgroup_schemata_write(struct kernfs_open_file *of,
continue;
if (!strcmp(resname, s->name)) {
- ret = resctrl_arch_update_domains(r, rdtgrp->closid);
+ ret = resctrl_arch_update_domains(r, rdtgrp->closid,
+ s->ctrl_type);
if (ret)
goto out;
}
diff --git a/fs/resctrl/monitor.c b/fs/resctrl/monitor.c
index 6c0804273753..5eccb38cb7d7 100644
--- a/fs/resctrl/monitor.c
+++ b/fs/resctrl/monitor.c
@@ -514,7 +514,8 @@ static void update_mba_bw(struct rdtgroup *rgrp, struct rdt_domain *dom_mbm)
return;
}
- resctrl_arch_update_one(r_mba, dom_mba, closid, CDP_NONE, new_msr_val);
+ resctrl_arch_update_one(r_mba, dom_mba, closid, CDP_NONE, new_msr_val,
+ SCHEMA_BASIC);
/*
* Delta values are updated dynamically package wise for each
diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c
index 92d9bee210eb..d71fac0ae4d4 100644
--- a/fs/resctrl/rdtgroup.c
+++ b/fs/resctrl/rdtgroup.c
@@ -3136,7 +3136,8 @@ static int rdtgroup_init_alloc(struct rdtgroup *rdtgrp)
return ret;
}
- ret = resctrl_arch_update_domains(r, rdtgrp->closid);
+ ret = resctrl_arch_update_domains(r, rdtgrp->closid,
+ s->ctrl_type);
if (ret < 0) {
rdt_last_cmd_puts("Failed to initialize allocations\n");
return ret;
diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h
index 2c0dc01d070e..f28d4ff737dc 100644
--- a/include/linux/resctrl.h
+++ b/include/linux/resctrl.h
@@ -334,7 +334,8 @@ int resctrl_rdtgroup_show(struct seq_file *seq, u32 closid, u32 rmid);
u32 resctrl_arch_get_num_closid(struct rdt_resource *r);
struct rdt_domain *resctrl_arch_find_domain(struct rdt_resource *r, int id);
-int resctrl_arch_update_domains(struct rdt_resource *r, u32 closid);
+int resctrl_arch_update_domains(struct rdt_resource *r, u32 closid,
+ enum resctrl_ctrl_type type);
/* For use by arch code that needs to remap resctrl's smaller CDP closid */
static inline u32 resctrl_get_config_index(u32 closid,
@@ -374,7 +375,8 @@ resctrl_get_domain_from_cpu(int cpu, struct rdt_resource *r)
* Must be called on one of the domain's CPUs.
*/
int resctrl_arch_update_one(struct rdt_resource *r, struct rdt_domain *d,
- u32 closid, enum resctrl_conf_type t, u32 cfg_val);
+ u32 closid, enum resctrl_conf_type t, u32 cfg_val,
+ enum resctrl_ctrl_type ctrl_type);
u32 resctrl_arch_get_config(struct rdt_resource *r, struct rdt_domain *d,
u32 closid, enum resctrl_conf_type type,
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2024-01-17 14:15 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-17 14:13 [PATCH v1 00/14] ARM: MPAM: add support for priority partitioning control Amit Singh Tomar
2024-01-17 14:13 ` [PATCH v1 01/14] fs/resctrl: group the resource control types for schemata list Amit Singh Tomar
2024-01-17 19:21 ` Peter Newman
2024-01-17 14:13 ` [PATCH v1 02/14] arm_mpam: resctrl: Detect priority partitioning capability Amit Singh Tomar
2024-01-17 14:13 ` [PATCH v1 03/14] arm_mpam: resctrl: extend the schemata list to support priority partition Amit Singh Tomar
2024-01-17 14:13 ` [PATCH v1 04/14] fs/resctrl: Set-up downstream priority partition resources Amit Singh Tomar
2024-01-17 14:13 ` [PATCH v1 05/14] fs/resctrl: fetch configuration based on control type Amit Singh Tomar
2024-01-17 14:13 ` [PATCH v1 06/14] arm_mpam: resctrl: Retrieve priority values from arch code Amit Singh Tomar
2024-01-17 14:13 ` [PATCH v1 07/14] fs/resctrl: Schemata write only for intended resource Amit Singh Tomar
2024-01-17 14:13 ` [PATCH v1 08/14] fs/resctrl: Extend schemata write for priority partition control Amit Singh Tomar
2024-01-17 14:14 ` Amit Singh Tomar [this message]
2024-01-17 14:14 ` [PATCH v1 10/14] arm_mpam: resctrl: Facilitate writing downstream priority value Amit Singh Tomar
2024-01-17 14:14 ` [PATCH v1 11/14] arm_mpam: Fix Downstream and internal priority mask Amit Singh Tomar
2024-01-17 14:14 ` [PATCH v1 12/14] arm_mpam: Program Downstream priority value Amit Singh Tomar
2024-01-17 14:14 ` [PATCH v1 13/14] arm_mpam: Handle resource instances mapped to different controls Amit Singh Tomar
2024-01-17 18:03 ` Peter Newman
2024-01-19 13:01 ` [EXT] " Amit Singh Tomar
2024-01-19 22:05 ` Peter Newman
2024-05-08 13:55 ` Amit Singh Tomar
2024-01-17 14:14 ` [PATCH v1 14/14] arm64/mpam: resctrl: export DSPRI value to info directory Amit Singh Tomar
2024-01-17 23:59 ` [PATCH v1 00/14] ARM: MPAM: add support for priority partitioning control Reinette Chatre
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=20240117141405.3063506-10-amitsinght@marvell.com \
--to=amitsinght@marvell.com \
--cc=dfustini@baylibre.com \
--cc=fenghua.yu@intel.com \
--cc=gcherian@marvell.com \
--cc=james.morse@arm.com \
--cc=jonathan.cameron@huawei.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).