Re: [PATCH v5 07/16] fs/resctrl: Introduce resctrl_set_kmode_support() to register supported modes

From: Babu Moger

Date: Thu Sep 17 2026 - 11:09:11 EST


Hi Reinette,

On 9/16/26 00:29, Reinette Chatre wrote:
Hi Babu,

On 8/26/26 12:32 PM, Babu Moger wrote:

diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c
index 3c53f3f74e5a..3bb0e3a203ac 100644
--- a/fs/resctrl/rdtgroup.c
+++ b/fs/resctrl/rdtgroup.c
@@ -892,6 +892,19 @@ static int rdtgroup_rmid_show(struct kernfs_open_file *of,
return ret;
}
+/**
+ * resctrl_set_kmode_support() - Register a supported kernel mode
+ * @kmode: Kernel mode policy supported by the architecture.

How is "Kernel mode" different from "Kernel mode policy"?

It should be just "kernel mode".


+ *
+ * Set the corresponding bit in resctrl_kcfg.caps.kmode_sup so @kmode
+ * is visible to the resctrl file system.

Verbatim description of what can be seen from the code.

ok.


+ */
+void resctrl_set_kmode_support(enum resctrl_kernel_mode kmode)
+{
+ if (kmode < RESCTRL_NUM_KERNEL_MODES)
+ __set_bit(kmode, resctrl_kcfg.caps.kmode_sup);
+}
+
#ifdef CONFIG_PROC_CPU_RESCTRL
/*
* A task can only be part of one resctrl control group and of one monitor
diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h
index 8b30eef835aa..051aece77eb9 100644
--- a/include/linux/resctrl.h
+++ b/include/linux/resctrl.h
@@ -729,6 +729,23 @@ enum resctrl_kernel_mode {
#define RESCTRL_NUM_KERNEL_MODES (RESCTRL_KMODE_LAST + 1)
+/**
+ * resctrl_set_kmode_support() - Register a supported kernel mode
+ * @kmode: Kernel mode supported by the architecture.
+ *
+ * Set the corresponding bit in resctrl_kcfg.caps.kmode_sup so @kmode

No need to describe resctrl fs internal details here.

ok.

Thanks
Babu