RE: [PATCH v5 8/8] selftests/resctrl: Adjust effective L3 cache size when SNC enabled

From: Luck, Tony
Date: Wed Sep 20 2023 - 11:03:15 EST


> What about outputing this value to userspace from resctrl? The ratio is
> already saved inside snc_nodes_per_l3_cache variable. And that would
> help avoid these difficult cases when some cpus are offline which could
> cause snc_ways() to return a wrong value. Or are there some pitfalls
> to that approach?

My original patch series added an "snc_ways" file to the info/ directory
to make this visible. But I was talked out of it because of a lack of clear
user mode use case that needs it.

https://lore.kernel.org/all/f0841866-315b-4727-0a6c-ec60d22ca29c@xxxxxxx/

I don't know if the resctrl self tests constitute a valid use case. Perhaps not
as they can figure this out.

But ... maybe the difficulties that user mode has (because of possibly offline
CPUs) are an indicator that the kernel should expose this. If only to
make the kernel's view clear in case there are situations where it got the
calculation wrong. E.g. kernel booted with a maxcpus=N parameter.

-Tony