Re: [PATCH v21 13/18] x86/resctrl: Handle removing directories in Sub-NUMA Cluster (SNC) mode

From: Reinette Chatre
Date: Tue Jun 25 2024 - 19:31:53 EST


Hi Tony,

On 6/21/24 3:38 PM, Tony Luck wrote:
In SNC mode there are multiple subdirectories in each L3 level monitor
directory (one for each SNC node). If all the CPUs in an SNC node are
taken offline, just remove the SNC directory for that node. In
non-SNC mode, or when the last SNC node directory is removed,
remove the L3 monitor directory.

Signed-off-by: Tony Luck <tony.luck@xxxxxxxxx>
---
arch/x86/kernel/cpu/resctrl/rdtgroup.c | 39 +++++++++++++++++++++-----
1 file changed, 32 insertions(+), 7 deletions(-)

diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
index 2591a6876232..14482d88b68c 100644
--- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
+++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
@@ -3008,20 +3008,45 @@ static int mon_addfile(struct kernfs_node *parent_kn, const char *name,
/*
* Remove all subdirectories of mon_data of ctrl_mon groups
- * and monitor groups with given domain id.
+ * and monitor groups for the given domain. In SNC mode just

I do not think we want the Intel architecture specific "SNC" to be
a "mode" of resctrl fs. That means all architectures need a "SNC mode".
How about something like (please feel free to improve):
Remove files and directories containing "sum" of domain data
when last domain being summed is removed.


With mention of "SNC mode" removed:
| Reviewed-by: Reinette Chatre <reinette.chatre@xxxxxxxxx>

Reinette