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 01/14] fs/resctrl: group the resource control types for schemata list
Date: Wed, 17 Jan 2024 19:43:52 +0530 [thread overview]
Message-ID: <20240117141405.3063506-2-amitsinght@marvell.com> (raw)
In-Reply-To: <20240117141405.3063506-1-amitsinght@marvell.com>
At the moment, resource control group support the basic control features
(that can be applied to system resources like cache, and Memory)
such as CAT (Cache Allocation Technology), and MBA (Memory Bandwidth
Allocation).
Apart from these basic controls, System can support other controls that
does not directly affect the allocation of memory-system resources.
Instead, it has an effect on conflicts that arise during access to
resources, such as Priority partitioning found on ARM MPAM.
In order to support control types of different nature, lets divide them
into different groups, already existing control features (CAT, and MBA)
is grouped under basic schemata type .i.e. SCHEMATA_BASIC, and to support
priority partition (the downstream priority one), it is placed under
SCHEMA_DSPRI control type. These control type is associated with list(s)
of schemata.
Signed-off-by: Amit Singh Tomar <amitsinght@marvell.com>
---
Changes since RFC:
* No change, it's new patch.
---
fs/resctrl/rdtgroup.c | 26 ++++++++++++++++----------
include/linux/resctrl.h | 1 +
include/linux/resctrl_types.h | 6 ++++++
3 files changed, 23 insertions(+), 10 deletions(-)
diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c
index 9c5dfaaa7fa2..12e31d4dddf6 100644
--- a/fs/resctrl/rdtgroup.c
+++ b/fs/resctrl/rdtgroup.c
@@ -2256,7 +2256,9 @@ static int rdt_enable_ctx(struct rdt_fs_context *ctx)
return ret;
}
-static int schemata_list_add(struct rdt_resource *r, enum resctrl_conf_type type)
+static int schemata_list_add(struct rdt_resource *r,
+ enum resctrl_conf_type type,
+ enum resctrl_ctrl_type ctrl_type)
{
struct resctrl_schema *s;
const char *suffix = "";
@@ -2284,10 +2286,12 @@ static int schemata_list_add(struct rdt_resource *r, enum resctrl_conf_type type
break;
}
- ret = snprintf(s->name, sizeof(s->name), "%s%s", r->name, suffix);
- if (ret >= sizeof(s->name)) {
- kfree(s);
- return -EINVAL;
+ if (ctrl_type == SCHEMA_BASIC) {
+ ret = snprintf(s->name, sizeof(s->name), "%s%s", r->name, suffix);
+ if (ret >= sizeof(s->name)) {
+ kfree(s);
+ return -EINVAL;
+ }
}
cl = strlen(s->name);
@@ -2300,14 +2304,15 @@ static int schemata_list_add(struct rdt_resource *r, enum resctrl_conf_type type
if (r->cdp_capable && !resctrl_arch_get_cdp_enabled(r->rid))
cl += 4;
- if (cl > max_name_width)
+ if (cl > max_name_width && ctrl_type == SCHEMA_BASIC)
max_name_width = cl;
/*
* Choose a width for the resource data based on the resource that has
* widest cbm/data_width.
*/
- max_data_width = max(max_data_width, r->data_width);
+ if (ctrl_type == SCHEMA_BASIC)
+ max_data_width = max(max_data_width, r->data_width);
INIT_LIST_HEAD(&s->list);
list_add(&s->list, &resctrl_schema_all);
@@ -2328,17 +2333,18 @@ static int schemata_list_create(void)
continue;
if (resctrl_arch_get_cdp_enabled(r->rid)) {
- ret = schemata_list_add(r, CDP_CODE);
+ ret = schemata_list_add(r, CDP_CODE, SCHEMA_BASIC);
if (ret)
break;
- ret = schemata_list_add(r, CDP_DATA);
+ ret = schemata_list_add(r, CDP_DATA, SCHEMA_BASIC);
} else {
- ret = schemata_list_add(r, CDP_NONE);
+ ret = schemata_list_add(r, CDP_NONE, SCHEMA_BASIC);
}
if (ret)
break;
+
}
return ret;
diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h
index 3ad308e9e226..125c4b0c2ff7 100644
--- a/include/linux/resctrl.h
+++ b/include/linux/resctrl.h
@@ -249,6 +249,7 @@ struct resctrl_schema {
struct list_head list;
char name[8];
enum resctrl_conf_type conf_type;
+ enum resctrl_ctrl_type ctrl_type;
struct rdt_resource *res;
u32 num_closid;
};
diff --git a/include/linux/resctrl_types.h b/include/linux/resctrl_types.h
index 3897de9c4ecb..b9268ec3ba71 100644
--- a/include/linux/resctrl_types.h
+++ b/include/linux/resctrl_types.h
@@ -57,6 +57,12 @@ enum resctrl_res_level {
RDT_NUM_RESOURCES,
};
+enum resctrl_ctrl_type {
+ SCHEMA_BASIC = 0,
+ SCHEMA_DSPRI,
+ SCHEMA_NUM_CTRL_TYPE
+};
+
#define CDP_NUM_TYPES (CDP_DATA + 1)
/*
--
2.25.1
next prev parent reply other threads:[~2024-01-17 14:14 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 ` Amit Singh Tomar [this message]
2024-01-17 19:21 ` [PATCH v1 01/14] fs/resctrl: group the resource control types for schemata list 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 ` [PATCH v1 09/14] fs/resctrl: set configuration based on Control type Amit Singh Tomar
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-2-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
all inboxes | Powered by JetHome®