Re: [PATCH 1/3] fs/resctrl: Add helpers to check io_alloc support and enabled state
From: Moger, Babu
Date: Fri Dec 05 2025 - 14:35:41 EST
Hi Aaron,
On 11/26/2025 11:16 AM, Aaron Tomlin wrote:
This patch introduces two helpers to validate io_alloc support and
whether it is enabled. This reduces code duplication, clarifies
intent, and preserves existing semantics and messages.
Signed-off-by: Aaron Tomlin <atomlin@xxxxxxxxxxx>
---
fs/resctrl/ctrlmondata.c | 74 +++++++++++++++++++++++++++++-----------
1 file changed, 54 insertions(+), 20 deletions(-)
diff --git a/fs/resctrl/ctrlmondata.c b/fs/resctrl/ctrlmondata.c
index b2d178d3556e..5f6f96d70e4a 100644
--- a/fs/resctrl/ctrlmondata.c
+++ b/fs/resctrl/ctrlmondata.c
@@ -758,6 +758,50 @@ u32 resctrl_io_alloc_closid(struct rdt_resource *r)
return resctrl_arch_get_num_closid(r) - 1;
}
+/*
+ * check_io_alloc_support() - Establish if io_alloc is supported
+ *
+ * @s: resctrl resource schema.
+ *
+ * This function must be called under the cpu hotplug lock
+ * and rdtgroup mutex
+ *
+ * Return: 0 on success, negative error code otherwise.
+ */
+static int check_io_alloc_support(struct resctrl_schema *s)
For consistency, how about changing the name to
resctrl_io_alloc_supported() and
resctrl_io_alloc_enabled()
Thanks
Babu