[RFC 04/12] fs/resctrl: Obtain CPBM upon priority partition presence

Amit Singh Tomar amitsinght at marvell.com
Tue Aug 15 08:27:04 PDT 2023


Resource control group's "schemata" file represents the cache portion
bit map (XXXX), parsed from buffer with "L3:0=XXXX" format. Now, with
the introduction of priority control, "schemata" file format has changed
to "L3:0=XXXX,X", where cpbm (XXXX) is split from priority mask(X) using
using delimiter ",".

With this change, CPBM is properly fetched from schemata file when priority
partition support is present.

Signed-off-by: Amit Singh Tomar <amitsinght at marvell.com>
---
 fs/resctrl/ctrlmondata.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/resctrl/ctrlmondata.c b/fs/resctrl/ctrlmondata.c
index 27d8bc25a4cb..b19ac2509e38 100644
--- a/fs/resctrl/ctrlmondata.c
+++ b/fs/resctrl/ctrlmondata.c
@@ -108,6 +108,9 @@ static bool cbm_validate(char *buf, u32 *data, struct rdt_resource *r)
 	unsigned int cbm_len = r->cache.cbm_len;
 	int ret;
 
+	if (r->priority_cap)
+		buf = strsep(&buf, ",");
+
 	ret = kstrtoul(buf, 16, &val);
 	if (ret) {
 		rdt_last_cmd_printf("Non-hex character in the mask %s\n", buf);
-- 
2.25.1




More information about the linux-arm-kernel mailing list