Re: [RFC PATCH 13/19] x86/resctrl: Add PLZA state tracking and context switch handling

From: Babu Moger

Date: Tue Feb 17 2026 - 11:39:27 EST


Hi Ben,

On 2/17/26 09:56, Ben Horgan wrote:
Hi Babu,

On 2/16/26 22:52, Moger, Babu wrote:
Hi Ben,

On 2/16/2026 9:41 AM, Ben Horgan wrote:
Hi Babu, Reinette,

On 2/14/26 00:10, Reinette Chatre wrote:
Hi Babu,

On 2/13/26 8:37 AM, Moger, Babu wrote:
Hi Reinette,

On 2/10/2026 10:17 AM, Reinette Chatre wrote:
Hi Babu,

On 1/28/26 9:44 AM, Moger, Babu wrote:

On 1/28/2026 11:41 AM, Moger, Babu wrote:
On Wed, Jan 28, 2026 at 10:01:39AM -0600, Moger, Babu wrote:
On 1/27/2026 4:30 PM, Luck, Tony wrote:
Babu,

I've read a bit more of the code now and I think I understand more.

Some useful additions to your explanation.

1) Only one CTRL group can be marked as PLZA
Yes. Correct.
Why limit it to one CTRL_MON group and why not support it for MON
groups?
There can be only one PLZA configuration in a system. The values in
the MSR_IA32_PQR_PLZA_ASSOC register (RMID, RMID_EN, CLOSID,
CLOSID_EN) must be identical across all logical processors. The only
field that may differ is PLZA_EN.
Does this have any effect on hypervisors?
Because hypervisor runs at CPL0, there could be some use case. I have
not completely understood that part.

ah - this is a significant part that I missed. Since this is a per-
CPU register it seems
I also missed that.

to have the ability for expanded use in the future where different
CLOSID and RMID may be
written to it? Is PLZA leaving room for such future enhancement or
does the spec contain
the text that state "The values in the MSR_IA32_PQR_PLZA_ASSOC
register (RMID, RMID_EN,
CLOSID, CLOSID_EN) must be identical across all logical processors."?
That is, "forever
and always"?

If I understand correctly MPAM could have different PARTID and PMG
for kernel use so we
need to consider these different architectural behaviors.
Yes, MPAM has a per-cpu register MPAM1_EL1.

oh ok.

I was initially unsure which RMID should be used when PLZA is
enabled on MON groups.

After re-evaluating, enabling PLZA on MON groups is still feasible:

1. Only one group in the system can have PLZA enabled.
2. If PLZA is enabled on CTRL_MON group then we cannot enable PLZA
on MON group.
3. If PLZA is enabled on the CTRL_MON group, then the CLOSID and
RMID of the CTRL_MON group can be written.
4. If PLZA is enabled on a MON group, then the CLOSID of the
CTRL_MON group can be used, while the RMID of the MON group can be
written.
Given that CLOSID and RMID are fixed once in the PLZA configuration
could this be simplified by just assuming they have the values of the
default group, CLOSID=0 and RMID=0 and let the user base there
configuration on that?

I didn't understand this question. There are 16 CLOSIDs and 1024 RMIDs.
We can use any one of these to enable PLZA.  It is not fixed in that sense.
Sorry, I wasn't clear. What I'm trying to understand is what you gain by
this flexibility. Given that the values CLOSID and the RMID are just
identifiers within the hardware and have only the meaning they are given
by the grouping and controls/monitors set up by resctrl (or any other
software interface) would you lose anything by just saying the PLZA
group has CLOSID=0 and RMID=0. Is there value in changing the PLZA
CLOSID and RMID or can the same effect happen by just changing the
resctrl configuration?

I was also wondering if using the default group this way would mean that
you wouldn't need to reserve the group for only kernel use.

Yes, that is an option, but it becomes too restrictive. Would this approach work for the ARM implementation?

If a user wants to keep a selective set of tasks running at different allocation levels, they would need to create another new group, move all tasks  from default group to new group, and leave only the selected tasks in the default group.

And if that group is later deleted, all tasks will automatically return to the default group.

Thanks,
Babu