[RFC PATCH 8/8] fs/resctrl: Suppress creation of cbm_mask info file on asymmetric systems

From: Tony Luck

Date: Mon Oct 26 2026 - 17:59:02 EST


Hybrid CPUs with a mix of P-cores and E-cores may support different
cache allocation bit masks. The per-domain masks are described in the
info/L2A/schemata/L2A/max file.

The cbm_mask file contains a single value and cannot describe an
asymmetric system.

Skip creating cbm_mask in the info/L2A directory.

Signed-off-by: Tony Luck <tony.luck@xxxxxxxxx>
---
Documentation/filesystems/resctrl.rst | 4 ++++
fs/resctrl/internal.h | 2 ++
fs/resctrl/rdtgroup.c | 5 ++++-
3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/Documentation/filesystems/resctrl.rst b/Documentation/filesystems/resctrl.rst
index de162280a0fe..25e9e5e5e738 100644
--- a/Documentation/filesystems/resctrl.rst
+++ b/Documentation/filesystems/resctrl.rst
@@ -91,6 +91,10 @@ related to allocation:
"cbm_mask":
The bitmask which is valid for this resource.
This mask is equivalent to 100%.
+ Not present for asymmetric L2 allocation (L2A), where
+ valid masks can differ between domains. Use the bitmap
+ control's "max" file under "info/L2A/schemata/" to obtain
+ the per-domain masks.
"min_cbm_bits":
The minimum number of consecutive bits which
must be set when writing a mask.
diff --git a/fs/resctrl/internal.h b/fs/resctrl/internal.h
index 4bd09b1541c7..d93d349db08b 100644
--- a/fs/resctrl/internal.h
+++ b/fs/resctrl/internal.h
@@ -261,6 +261,8 @@ struct rdtgroup {

#define RFTYPE_RES_PERF_PKG BIT(12)

+#define RFTYPE_RES_COMMON_CBM BIT(13)
+
#define RFTYPE_CTRL_INFO (RFTYPE_INFO | RFTYPE_CTRL)

#define RFTYPE_MON_INFO (RFTYPE_INFO | RFTYPE_MON)
diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c
index 46d39332706e..5cf6a257bea8 100644
--- a/fs/resctrl/rdtgroup.c
+++ b/fs/resctrl/rdtgroup.c
@@ -2196,7 +2196,8 @@ static struct rftype res_common_files[] = {
.mode = 0444,
.kf_ops = &rdtgroup_kf_single_ops,
.seq_show = rdt_default_ctrl_show,
- .fflags = RFTYPE_CTRL_INFO | RFTYPE_RES_CACHE,
+ .fflags = RFTYPE_CTRL_INFO | RFTYPE_RES_CACHE |
+ RFTYPE_RES_COMMON_CBM,
},
{
.name = "num_mbm_cntrs",
@@ -3024,6 +3025,8 @@ static int rdtgroup_create_info_dir(struct kernfs_node *parent_kn)
list_for_each_entry(f, &rdt_resource_final_all, list) {
r = f->res;
fflags = fflags_from_resource(r) | RFTYPE_CTRL_INFO;
+ if ((fflags & RFTYPE_RES_CACHE) && !r->asymmetric)
+ fflags |= RFTYPE_RES_COMMON_CBM;
kn_res = rdtgroup_mkdir_info_resdir(f, f->name, fflags);
if (IS_ERR(kn_res)) {
ret = PTR_ERR(kn_res);
--
2.56.0