Skip to contentSkip to conversation

fs/resctrl: Show domain CPU list in schema output

PATCH In review Aaron Tomlin 3 participants 6 messages Oct 31, 2025 – Nov 6, 2025 RDT - resource allocation

lore
Share & tools
lore
#0 lore raw

cover fs/resctrl: Show domain CPU list in schema output

Hi Babu,

Following up on your work in the x86,fs/resctrl: Support L3 Smart Data Cache Injection Allocation Enforcement (SDCIAE) series, I've prepared a small enhancement.

The current resctrl schemata output provides only the domain ID and value (e.g., 0=ffff). This patch updates the schema format to include the underlying topology, making it easier for users to correlate the resource domain with its assigned logical CPUs.

The output changes from "0=ffff" to "0=ffff,0-15".

Please let me know your thoughts.

Aaron Tomlin (1):
fs/resctrl: Show domain CPU list in schema output

 fs/resctrl/ctrlmondata.c | 4 +++-
 fs/resctrl/rdtgroup.c    | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)
Signature · 1 line
2.51.0
#1 lore raw

PATCH 1/1 fs/resctrl: Show domain CPU list in schema output

The resctrl schemata output currently displays only the domain ID and its configured value e.g., "0=ffff". This format lacks visibility into the underlying topology, making it difficult for users to quickly verify which logical CPUs belong to the listed resource domain.

This patch improves visibility and aids in validation when configuring or monitoring resource groupings, changing the output format from "0=ffff" to "0=ffff,0-15".

---
 fs/resctrl/ctrlmondata.c | 4 +++-
 fs/resctrl/rdtgroup.c    | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)
fs/resctrl/ctrlmondata.c +3 -1
index 0d0ef54fc4de..5ad12d15b350 100644
@@ -402,7 +402,9 @@ static void show_doms(struct seq_file *s, struct resctrl_schema *schema, int clo
 			ctrl_val = resctrl_arch_get_config(r, dom, closid,
 							   schema->conf_type);
 
-		seq_printf(s, schema->fmt_str, dom->hdr.id, ctrl_val);
+		seq_printf(s, schema->fmt_str, dom->hdr.id, ctrl_val,
+			   cpumask_pr_args(&dom->hdr.cpu_mask));
+
 		sep = true;
 	}
 	seq_puts(s, "\n");
fs/resctrl/rdtgroup.c +2 -2
index 0320360cd7a6..cec89ae549e0 100644
@@ -2661,10 +2661,10 @@ static int schemata_list_add(struct rdt_resource *r, enum resctrl_conf_type type
 
 	switch (r->schema_fmt) {
 	case RESCTRL_SCHEMA_BITMAP:
-		s->fmt_str = "%d=%x";
+		s->fmt_str = "%d=%x,%*pbl";
 		break;
 	case RESCTRL_SCHEMA_RANGE:
-		s->fmt_str = "%d=%u";
+		s->fmt_str = "%d=%u,%*pbl";
 		break;
 	}
 
Signature · 1 line
2.51.0
maintainer
#2 lore raw
In reply to Aaron Tomlin
Quoted 8 lines

The current resctrl schemata output provides only the domain ID and value (e.g., 0=ffff). This patch updates the schema format to include the underlying topology, making it easier for users to correlate the resource domain with its assigned logical CPUs.

The output changes from "0=ffff" to "0=ffff,0-15".

Please let me know your thoughts.

1) You'd also need to change the "write" path for the schemata file (treating the CPU list as read-only).

2) This would break user ABI, so is not going to happen.

Users can see the association between the domain numbers and CPUs in sysfs.

$ cat /sys/devices/system/cpu/cpu0/cache/index3/id
0
$ cat /sys/devices/system/cpu/cpu0/cache/index3/shared_cpu_list
0-27

Maybe not as convenient as a direct read-out in the schemata file. But the information is easily accessible.

-Tony

#3 lore raw
Quoted 4 lines · Tony

1) You'd also need to change the "write" path for the schemata file (treating the CPU list as read-only).

2) This would break user ABI, so is not going to happen.

Hi Tony,

Thank you for following up.

If I understand correctly, parse_cbm() and parse_bw() would return -EINVAL if the user incorrectly included the CPU list, no?

I suspect the issue is if one can read something from a file, one should be able to write the same thing back and have it either succeed or process only the valid parts. I agree maintaining ABI compatibility while allowing the new verbose output on the read path is not ideal.

Quoted 10 lines

Users can see the association between the domain numbers and CPUs in sysfs.

$ cat /sys/devices/system/cpu/cpu0/cache/index3/id
0
$ cat /sys/devices/system/cpu/cpu0/cache/index3/shared_cpu_list
0-27

Maybe not as convenient as a direct read-out in the schemata file. But the information is easily accessible.

No, using the above to establish the association is absolutely fine.

Kind regards,

Signature · 1 line
Aaron Tomlin
reviewer
#4 lore raw

Hi,

Quoted 10 lines · Aaron Tomlin
Quoted 4 lines · Tony

1) You'd also need to change the "write" path for the schemata file (treating the CPU list as read-only).

2) This would break user ABI, so is not going to happen.

Hi Tony,

Thank you for following up.

Quoted 7 lines

If I understand correctly, parse_cbm() and parse_bw() would return -EINVAL if the user incorrectly included the CPU list, no?

I suspect the issue is if one can read something from a file, one should be able to write the same thing back and have it either succeed or process only the valid parts. I agree maintaining ABI compatibility while allowing the new verbose output on the read path is not ideal.

Partly, but existing software that reads the file is also likely to get confused by the new syntax appearing when reading the file.

(Nothing requires the data read out from the file to resemble what is written in, though it certainly less surprising for userspace if it looks the same, and if the data read will be accepted, with the same meaning, when written back in.)

Note, using a comma as a delimiter may be problematic with %pbl-style lists, since if the list is discontiguous then the pretty-printed list can contain commas too.

On my system:

$ cat /sys/devices/system/cpu/cpu0/cache/index3/shared_cpu_list
-->
0-15,32-47
Quoted 8 lines
Quoted 8 lines

Users can see the association between the domain numbers and CPUs in sysfs.

$ cat /sys/devices/system/cpu/cpu0/cache/index3/id
0
$ cat /sys/devices/system/cpu/cpu0/cache/index3/shared_cpu_list
0-27
Quoted 4 lines
Quoted 2 lines

Maybe not as convenient as a direct read-out in the schemata file. But the information is easily accessible.

No, using the above to establish the association is absolutely fine.

In theory, a alternate write syntax could be supported without breaking compatibility, say:

	cpu<n>=<mask>

instead of

	<domain>=<main>

as a alternative way of referring to the control domain containing CPU <n>.

But I think that this may do as much harm as good -- if the user doesn't understand the topology, trying to program the masks on a per- CPU basis isn't going to work do what the user wants anyway.

So I think we'd want a good argument as to why this is needed / useful.

Cheers
---Dave

#5 lore raw
Quoted 2 lines · Dave Martin

Partly, but existing software that reads the file is also likely to get confused by the new syntax appearing when reading the file.

Hi Dave,

Thank you for your feedback.

I agree.

Quoted 3 lines

Note, using a comma as a delimiter may be problematic with %pbl-style lists, since if the list is discontiguous then the pretty-printed list can contain commas too.

Fair point.

Quoted 9 lines

In theory, a alternate write syntax could be supported without breaking compatibility, say:

	cpu<n>=<mask>

instead of

	<domain>=<main>
Quoted 8 lines

as a alternative way of referring to the control domain containing CPU <n>.

But I think that this may do as much harm as good -- if the user doesn't understand the topology, trying to program the masks on a per- CPU basis isn't going to work do what the user wants anyway.

So I think we'd want a good argument as to why this is needed / useful.

Understood. What Tony mentioned previously is sufficient; I should have reviewed drivers/base/cacheinfo.c before posting.

Kind regards,

Signature · 1 line
Aaron Tomlin