Re: [PATCH v8 1/2] selftests/resctrl: Adjust effective L3 cache size with SNC enabled

From: Reinette Chatre
Date: Mon Dec 16 2024 - 16:45:05 EST


Hi Maciej,

On 12/16/24 7:18 AM, Maciej Wieczor-Retman wrote:
> Sub-NUMA Cluster divides CPUs sharing an L3 cache into separate NUMA
> nodes. Systems may support splitting into either two, three, four or six
> nodes. When SNC mode is enabled the effective amount of L3 cache
> available for allocation is divided by the number of nodes per L3.
>
> It's possible to detect which SNC mode is active by comparing the number
> of CPUs that share a cache with CPU0, with the number of CPUs on node0.
>
> Detect SNC mode once and let other tests inherit that information.
>
> Update CFLAGS after including lib.mk in the Makefile so that fallthrough
> macro can be used.
>
> To check if SNC detection is reliable one can check the
> /sys/devices/system/cpu/offline file. If it's empty, it means all cores
> are operational and the ratio should be calculated correctly. If it has
> any contents, it means the detected SNC mode can't be trusted and should
> be disabled.
>
> Check if detection was not reliable due to offline cpus. If it was skip
> running tests since the results couldn't be trusted.
>
> Co-developed-by: Tony Luck <tony.luck@xxxxxxxxx>
> Signed-off-by: Tony Luck <tony.luck@xxxxxxxxx>
> Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@xxxxxxxxx>
> ---

Thank you very much.

Reviewed-by: Reinette Chatre <reinette.chatre@xxxxxxxxx>

Reinette