Skip to contentSkip to conversation

fs/resctrl: Ensure default group reports tasks on monitor-only systems

PATCH Applied Tony Luck 3 participants 3 messages Oct 9 – Oct 10 RDT - resource allocation

lore
Share & tools
lore

Tony Luck

author maintainer
#0 lore raw

PATCH v2 1/1 fs/resctrl: Ensure default group reports tasks on monitor-only systems

resctrl can be mounted on a system that supports monitoring but not allocation.

On such a system reading the "tasks" file in the default group reports no tasks, even when there are tasks assigned to the default group. This problem occurs because the check for whether a task belongs to a CTRL_MON group is gated by a check for whether the system supports allocation.

The resctrl_arch_alloc_capable() check in is_closid_match() breaks task reporting for the default group on monitor-only systems so remove this check. On systems that support allocation the check is redundant.

Fixes e6b2fac36fcc ("x86/resctrl: Use is_closid_match() in more places")

---
Changes since https://lore.kernel.org/all/[email protected]/

Dropped Assisted-by: tag. The LLM was only used for commit wordsmithing and I've now discarded everything it wrote.

Rewrote commit in 3-paragraph (context, problem, solution) format per Documentation/process/maintainer-tip.rst guidelines.

---
 fs/resctrl/rdtgroup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/resctrl/rdtgroup.c +1 -1
index 68be9b903ac6..57ab090072c2 100644
@@ -685,7 +685,7 @@ static int __rdtgroup_move_task(struct task_struct *tsk,
 
 static bool is_closid_match(struct task_struct *t, struct rdtgroup *r)
 {
-	return (resctrl_arch_alloc_capable() && (r->type == RDTCTRL_GROUP) &&
+	return (r->type == RDTCTRL_GROUP &&
 		resctrl_arch_match_closid(t, r->closid));
 }
 
Signature · 1 line
2.56.0
maintainer Reviewed-by on v2 1/1
#1 lore raw
Quoted 11 lines · Tony Luck

resctrl can be mounted on a system that supports monitoring but not allocation.

On such a system reading the "tasks" file in the default group reports no tasks, even when there are tasks assigned to the default group. This problem occurs because the check for whether a task belongs to a CTRL_MON group is gated by a check for whether the system supports allocation.

The resctrl_arch_alloc_capable() check in is_closid_match() breaks task reporting for the default group on monitor-only systems so remove this check. On systems that support allocation the check is redundant.

Quoted 5 lines
Fixes e6b2fac36fcc ("x86/resctrl: Use is_closid_match() in more places")

---

Reinette

merge bot Applied
#2 lore raw
In reply to Tony Luck
The following commit has been merged into the x86/cache branch of tip:

The following commit has been merged into the x86/cache branch of tip:

Commit-ID:     2c10b3fa5bdf61e344bc522e6c2e00d870ce7ab8
Gitweb:        https://git.kernel.org/tip/2c10b3fa5bdf61e344bc522e6c2e00d870ce7ab8
Author:        Tony Luck <[email protected]>
AuthorDate:    Fri, 09 Oct 2026 12:39:23 -07:00
Committer:     Borislav Petkov (AMD) <[email protected]>
CommitterDate: Fri, 09 Oct 2026 17:43:05 -07:00

fs/resctrl: Ensure default group reports tasks on monitor-only systems

resctrl can be mounted on a system that supports monitoring but not allocation.

On such a system reading the "tasks" file in the default group reports no tasks, even when there are tasks assigned to the default group. This problem occurs because the check for whether a task belongs to a CTRL_MON group is gated by a check for whether the system supports allocation.

The resctrl_arch_alloc_capable() check in is_closid_match() breaks task reporting for the default group on monitor-only systems so remove this check. On systems that support allocation the check is redundant.

---
 fs/resctrl/rdtgroup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/resctrl/rdtgroup.c +1 -1
index 68be9b9..57ab090 100644
@@ -685,7 +685,7 @@ static int __rdtgroup_move_task(struct task_struct *tsk,
 
 static bool is_closid_match(struct task_struct *t, struct rdtgroup *r)
 {
-	return (resctrl_arch_alloc_capable() && (r->type == RDTCTRL_GROUP) &&
+	return (r->type == RDTCTRL_GROUP &&
 		resctrl_arch_match_closid(t, r->closid));
 }