[PATCH v7 2/5] riscv_cbqri: resctrl: Add cache allocation via capacity block mask

Reinette Chatre reinette.chatre at intel.com
Tue Oct 13 14:29:41 PDT 2026


Hi Tony,

On 10/13/26 1:47 PM, Luck, Tony wrote:
> Reinette,
> 
> The system I'm working on has L2 caches that appear like this:
> 
> 	    L2:0=fff;1=fff;2=fff;3=fff;4=ffff;5=ffff;8=ffff
> 
> The P-cores support 12 ways in their L2 caches, the E-cores support 16 ways
> in each of the per-module L2 caches.
> 
> A legacy implementation would have to present just 12 ways across all
> domains to the user. The implementation of that has a couple of choices:
> 
> 1) Ignore 25% of the caches on the E-cores.
> 	Unlikely to please anyone.

Just like the percentage based memory bandwidth control is not able to
please everybody but it is something that can be exposed to not break userspace
while it can be emulated with the underlying hardware controls. Users needing
finer grained capability will have the option to switch to the native
controls.

> 2) Silently allow access to the "f000" ways of the E-core caches.
> 	Doesn't waste the hardware, but if the user tries to divide
> 	available cache exclusively between groups, the "free" extra
> 	cache would result in surprise sharing.

(2) requires the system to support sparse bitmasks.

> 
> The drive for L2 controls on hybrid systems comes from embedded systems
> where expectations would be for the controls to operate precisely as
> written without any fuzziness.
> 
> I'm not seeing a market for the legacy behavior, so implementing it
> would just add complexity to resctrl without any benefit to users.
> 
> Perhaps keep the "L2" resource name. Use "L2" for a control name for
> symmetric systems. Use "L2A" as the control name for asymmetric systems.
> Legacy software won't be confused because there won't be an "L2:"
> line in the schemata file.

This cannot simultaneously be a market that does not require legacy behavior
and require legacy software to not be confused. Unfortunately I believe
legacy software (which is the latest software today) will get confused.

I understand that there are many different utilities used to interact with
resctrl so behavior can vary. Based on my understanding of the pqos/intel-cmt-cat
utility the system's capabilities are determined by parsing /sys/fs/resctrl/info.
Based on this parsing the utility expects particular entries to exist in
schemata file and interacts with schemata file with this expectation without
checking whether a matching entry is actually in schemata file or not.

The utility will thus inform user space that L2 CAT is fully available but
when user space attempts any read/write the behavior will be unexpected.

> 
> Don't bother with a control_mode to switch between legacy and native.
> Just auto-select the "L2A" control on asymmetric systems.
> 
> But since this thread started from a RISC-V thread, it would be good to
> hear what is needed for RISC-V.
ack.

Reinette




More information about the linux-riscv mailing list