x86/resctrl: Handle removing directories in Sub-NUMA Cluster (SNC) mode
authorTony Luck <tony.luck@intel.com>
Tue, 2 Jul 2024 17:38:19 +0000 (10:38 -0700)
committerBorislav Petkov (AMD) <bp@alien8.de>
Tue, 2 Jul 2024 17:51:06 +0000 (19:51 +0200)
commit6b48b80b08e6f08eea8eaf7e44555ada191b6bee
tree60c1b2a5e922a5d11da0ffae0929e022850d091d
parent0158ed6a1335ff37f0336a986d7b99d6e97d46e9
x86/resctrl: Handle removing directories in Sub-NUMA Cluster (SNC) mode

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.

Add a helper function to avoid duplicated code.

Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Link: https://lore.kernel.org/r/20240702173820.90368-2-tony.luck@intel.com
arch/x86/kernel/cpu/resctrl/rdtgroup.c