mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [BOF]arm: resctrl: L3 cache partitioning via CLUSTERPARTCR
@ 2026-06-30 11:48 Aiqun(Maria) Yu
  2026-06-30 14:59 ` James Morse
  0 siblings, 1 reply; 3+ messages in thread
From: Aiqun(Maria) Yu @ 2026-06-30 11:48 UTC (permalink / raw)
  To: Tony Luck, Reinette Chatre, Dave Martin, James Morse, Ben Horgan
  Cc: x86, Babu Moger, linux-kernel, Reinette Chatre, Fenghua Yu,
	Trilok Soni, yiwei.huang, yin.li

Hi all,

L3 cache partitioning is an important feature for improving performance
isolation of latency-sensitive tasks. While ARM MPAM provides a
comprehensive solution, there exists another ARM register, CLUSTERPARTCR,
which offers L3 cache partitioning functionality similar to MPAM's CPBM
(Cache Portion BitMask) but is not part of the MPAM architecture.

CLUSTERPARTCR is a cluster-level register that allows software to partition
L3 cache capacity among different workloads. Although its partitioning
granularity and flexibility are more limited compared to full MPAM support,
it remains a practically important interface for platforms that do not
implement MPAM but still need L3 cache partitioning capability.

This raises the following questions for the community:

  1. Is there interest in accommodating CLUSTERPARTCR-based L3 partitioning
     within the existing resctrl framework, given that it provides similar
     semantics to Intel RDT's cache allocation technology (CAT)?

  2. Alternatively, would it be more appropriate to integrate it under the
     MPAM resctrl framework as a non-MPAM backend, given the functional
     similarity to MPAM CPBM?

  3. Are there any concerns or constraints in the current resctrl/MPAM
     framework that would prevent such an integration?

Any comments, suggestions, or pointers to prior discussion on this topic
are very much appreciated.

More references:
==========
Reference to [1], and more detailed information like below:
the CLUSTERPARTCR_EL1 to 0x00008601 to configure these three L3 cache
partitions:
• Scheme ID 0 (1/4 of the cache).
• Scheme ID 2 (1/2 of the cache).
• Scheme ID 3 (1/4 of the cache).


The OS, running at EL1, can set the CLUSTERTHREADSID_EL1 to 0x0 or 0x1
to select between the two L3 cache partitions allocated to it. These
would be mapped to scheme IDs 2 and 3 by the CLUSTERTHREADSIDOVR_EL1
register. The OS can update this register on context switches to select
which partition each process has access to.

[1]
https://developer.arm.com/documentation/100453/0401/L3-cache/L3-cache-partitioning?lang=en
-- 
Thx and BRs,
Aiqun(Maria) Yu


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [BOF]arm: resctrl: L3 cache partitioning via CLUSTERPARTCR
  2026-06-30 11:48 [BOF]arm: resctrl: L3 cache partitioning via CLUSTERPARTCR Aiqun(Maria) Yu
@ 2026-06-30 14:59 ` James Morse
  2026-12-01  7:55   ` Aiqun(Maria) Yu
  0 siblings, 1 reply; 3+ messages in thread
From: James Morse @ 2026-06-30 14:59 UTC (permalink / raw)
  To: Aiqun(Maria) Yu, Tony Luck, Reinette Chatre, Dave Martin, Ben Horgan
  Cc: x86, Babu Moger, linux-kernel, Fenghua Yu, Trilok Soni,
	yiwei.huang, yin.li

Hi Aiqun,

On 30/06/2026 12:48, Aiqun(Maria) Yu wrote:
> L3 cache partitioning is an important feature for improving performance
> isolation of latency-sensitive tasks. While ARM MPAM provides a
> comprehensive solution,

> there exists another ARM register, CLUSTERPARTCR,

It's important to note this isn't an ARM architecture feature or register,
it's part of one version of DSU, which is a shared-cache IP in some designs.


> which offers L3 cache partitioning functionality similar to MPAM's CPBM
> (Cache Portion BitMask) but is not part of the MPAM architecture.

... and as its not part of any architectural feature, is going to be very hard
to use.


> CLUSTERPARTCR is a cluster-level register that allows software to partition
> L3 cache capacity among different workloads. Although its partitioning
> granularity and flexibility are more limited compared to full MPAM support,
> it remains a practically important interface for platforms that do not
> implement MPAM but still need L3 cache partitioning capability.

This stuff is designed for static SoC configurations. e.g. CPU-4 is running
your modem stack. I don't this is going to work well with general purpose
things like linux and resctrl.


> This raises the following questions for the community:
> 
>   1. Is there interest in accommodating CLUSTERPARTCR-based L3 partitioning
>      within the existing resctrl framework, given that it provides similar
>      semantics to Intel RDT's cache allocation technology (CAT)?

I'd say that is impossible.

This would rely on accessing implementation defined system registers, not just
in some driver - but in the architecture's context-switch path. This has been a
hard no in the past. For just the imp-def part, see: [0][1][2]

Doing this doesn't virtualise as all those registers are trapped by HCR_EL2.TIDCP,
the hypervisor can't emulate these registers as they can behave differently on
each CPU. The only option is to emulate an undefined instruction exception.
This makes detecting the SoCs where this could be used very difficult.


>   2. Alternatively, would it be more appropriate to integrate it under the
>      MPAM resctrl framework as a non-MPAM backend, given the functional
>      similarity to MPAM CPBM?

I don't think its at all similar.

This doesn't map to the L3/CPBM bitmap schema. A group is 4 ways, and the control
is only to make a group private to an 'ID'. You can't share a group between two
resctrl groups - which the bitmap schema allows.

As an ugly corner case: if you tried to express the groups as a bitmap, a 12-way
cache configuration would have 3 groups - meaning a two bit bitmap has invalid values.

This is all because its not really a bitmap in hardware.


The datasheet/TRM you linked doesn't say that the partition controls can be changed
at runtime. Resctrl requires this.
While the document doesn't say either way - its very common for interconnect IP to
expect configuration information to only be written to during power-on, when there
is no traffic flowing in the system. Linux can't ever do this.


>   3. Are there any concerns or constraints in the current resctrl/MPAM
>      framework that would prevent such an integration?

Not just the imp-def system registers: There is no way of detecting whether
this is present in any particular SoC. You can't have a table of SoCs where
it happens to be as it also depends on the EL3 firmware to turn this interface
on, and a hypervisor not being present.

The system registers imply some knowledge of the topology, its not just which
CPUs share a DSU,  but where an 'ACP' goes, and what a 'STASH' is for.


It looks like there are 8 'partition scheme IDs', but only 'four private L3 cache
partitions can be created' - so depending on what is written to the schema file,
there may be only four control groups usable.


> Any comments, suggestions, or pointers to prior discussion on this topic
> are very much appreciated.
I don't think this is workable for either resctrl or the architecture code.

DSU supports MPAM, so presumably this is for an older version that doesn't have the
MPAM feature?


Thanks,

James

[0] https://lore.kernel.org/linux-arm-kernel/20151026124616.GB9740@leverpostej/
[1] https://lore.kernel.org/linux-arm-kernel/20201120101249.GA2328@C02TD0UTHF1T.local/
[2] https://lore.kernel.org/linux-arm-kernel/20210108125410.GA84941@C02TD0UTHF1T.local/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [BOF]arm: resctrl: L3 cache partitioning via CLUSTERPARTCR
  2026-06-30 14:59 ` James Morse
@ 2026-12-01  7:55   ` Aiqun(Maria) Yu
  0 siblings, 0 replies; 3+ messages in thread
From: Aiqun(Maria) Yu @ 2026-12-01  7:55 UTC (permalink / raw)
  To: James Morse, Tony Luck, Reinette Chatre, Dave Martin, Ben Horgan
  Cc: x86, Babu Moger, linux-kernel, Fenghua Yu, Trilok Soni,
	yiwei.huang, yin.li

On 6/30/2026 10:59 PM, James Morse wrote:
> Hi Aiqun,
> 
> On 30/06/2026 12:48, Aiqun(Maria) Yu wrote:
>> L3 cache partitioning is an important feature for improving performance
>> isolation of latency-sensitive tasks. While ARM MPAM provides a
>> comprehensive solution,
> 
>> there exists another ARM register, CLUSTERPARTCR,
> 
> It's important to note this isn't an ARM architecture feature or register,
> it's part of one version of DSU, which is a shared-cache IP in some designs.


Thx for the correction.
> 
> 
>> which offers L3 cache partitioning functionality similar to MPAM's CPBM
>> (Cache Portion BitMask) but is not part of the MPAM architecture.
> 
> ... and as its not part of any architectural feature, is going to be very hard
> to use.

It is hard, but still useful in some scenario. :)
> 
> 
>> CLUSTERPARTCR is a cluster-level register that allows software to partition
>> L3 cache capacity among different workloads. Although its partitioning
>> granularity and flexibility are more limited compared to full MPAM support,
>> it remains a practically important interface for platforms that do not
>> implement MPAM but still need L3 cache partitioning capability.
> 
> This stuff is designed for static SoC configurations. e.g. CPU-4 is running
> your modem stack. I don't this is going to work well with general purpose
> things like linux and resctrl.
> 
> 
>> This raises the following questions for the community:
>>
>>   1. Is there interest in accommodating CLUSTERPARTCR-based L3 partitioning
>>      within the existing resctrl framework, given that it provides similar
>>      semantics to Intel RDT's cache allocation technology (CAT)?
> 
> I'd say that is impossible.
> 
> This would rely on accessing implementation defined system registers, not just
> in some driver - but in the architecture's context-switch path. This has been a
> hard no in the past. For just the imp-def part, see: [0][1][2]

I see the good point here.
What about if we make the driver more standalone. And not context-switch
path affected. So it can be a scheme ID based configuration only. Only
specific tasks with the same scheme ID will be configured.
> 
> Doing this doesn't virtualise as all those registers are trapped by HCR_EL2.TIDCP,
> the hypervisor can't emulate these registers as they can behave differently on
> each CPU. The only option is to emulate an undefined instruction exception.
> This makes detecting the SoCs where this could be used very difficult.
> 
> 
>>   2. Alternatively, would it be more appropriate to integrate it under the
>>      MPAM resctrl framework as a non-MPAM backend, given the functional
>>      similarity to MPAM CPBM?
> 
> I don't think its at all similar.
> 
> This doesn't map to the L3/CPBM bitmap schema. A group is 4 ways, and the control
> is only to make a group private to an 'ID'. You can't share a group between two
> resctrl groups - which the bitmap schema allows.
> 
> As an ugly corner case: if you tried to express the groups as a bitmap, a 12-way
> cache configuration would have 3 groups - meaning a two bit bitmap has invalid values.
> 
> This is all because its not really a bitmap in hardware.
> 
> 
> The datasheet/TRM you linked doesn't say that the partition controls can be changed
> at runtime. Resctrl requires this.
> While the document doesn't say either way - its very common for interconnect IP to
> expect configuration information to only be written to during power-on, when there
> is no traffic flowing in the system. Linux can't ever do this.

Per current prototype, it can be runtime changed and functional as expected.

> 
> 
>>   3. Are there any concerns or constraints in the current resctrl/MPAM
>>      framework that would prevent such an integration?
> 
> Not just the imp-def system registers: There is no way of detecting whether
> this is present in any particular SoC. You can't have a table of SoCs where
> it happens to be as it also depends on the EL3 firmware to turn this interface
> on, and a hypervisor not being present.
> 
> The system registers imply some knowledge of the topology, its not just which
> CPUs share a DSU,  but where an 'ACP' goes, and what a 'STASH' is for.
> 
> 
> It looks like there are 8 'partition scheme IDs', but only 'four private L3 cache
> partitions can be created' - so depending on what is written to the schema file,
> there may be only four control groups usable.


Good point. So maybe we can have a standalone interface which is static
scheme ID base configuration only. Runtime specific interface to
configure for specific scheme ID. We can have an BOF driver example code
for reference if it is agreed.
> 
> 
>> Any comments, suggestions, or pointers to prior discussion on this topic
>> are very much appreciated.
> I don't think this is workable for either resctrl or the architecture code.
> 
> DSU supports MPAM, so presumably this is for an older version that doesn't have the
> MPAM feature?


yes. Here are the older versions that don't support MPAM.
> 
> 
> Thanks,
> 
> James
> 
> [0] https://lore.kernel.org/linux-arm-kernel/20151026124616.GB9740@leverpostej/
> [1] https://lore.kernel.org/linux-arm-kernel/20201120101249.GA2328@C02TD0UTHF1T.local/
> [2] https://lore.kernel.org/linux-arm-kernel/20210108125410.GA84941@C02TD0UTHF1T.local/


-- 
Thx and BRs,
Aiqun(Maria) Yu

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-12-01  7:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-30 11:48 [BOF]arm: resctrl: L3 cache partitioning via CLUSTERPARTCR Aiqun(Maria) Yu
2026-06-30 14:59 ` James Morse
2026-12-01  7:55   ` Aiqun(Maria) Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®