Re: [RFC PATCH 14/19] x86,fs/resctrl: Add the functionality to configure PLZA
From: Babu Moger
Date: Thu Jan 29 2026 - 14:54:30 EST
Hi Tony,
On 1/29/26 13:13, Luck, Tony wrote:
On Wed, Jan 21, 2026 at 03:12:52PM -0600, Babu Moger wrote:Correct.
Privilege Level Zero Association (PLZA) is configured by writing toArchitecturally this is true. But in the implementation for resctrl
MSR_IA32_PQR_PLZA_ASSOC. PLZA is disabled by default on all logical
processors in the QOS Domain. System software must follow the following
sequence.
1. Set the closid, closid_en, rmid and rmid_en fields of
MSR_IA32_PQR_PLZA_ASSOC to the desired configuration on all logical
processors in the QOS Domain.
2. Set MSR_IA32_PQR_PLZA_ASSOC[PLZA_EN]=1 for
all logical processors in the QOS domain where PLZA should be enabled.
MSR_IA32_PQR_PLZA_ASSOC[PLZA_EN] may have a different value on every
logical processor in the QOS domain. The system software should perform
this as a read-modify-write to avoid changing the value of closid_en,
closid, rmid_en, and rmid fields of MSR_IA32_PQR_PLZA_ASSOC.
there is only one PLZA group. So the CLOSID and RMID fields are
identical on every logical processor. The only changing bit is the
PLZA_EN.
The code could be simpler if you just maintained a single global
with the CLOSID/RMID bits initialized by resctrl_arch_plza_setup().
union qos_pqr_plza_assoc plza_value; // needs a better name
Yea. That is a good point. We don't have to store CLOSID/RMID in
per-CPU state. Will do those changes in my next revision.
Change the PLZA_EN define to be
#define PLZA_EN BIT_ULL(63)
and then the hook into the __resctrl_sched_in() becomes:
if (static_branch_likely(&rdt_plza_enable_key)) {
u32 plza = READ_ONCE(state->default_plza); // note, moved this inside the static branch
tmp = READ_ONCE(tsk->plza);
if (tmp)
plza = tmp;
if (plza != state->cur_plza) {
state->cur_plza = plza;
wrmsrq(MSR_IA32_PQR_PLZA_ASSOC,
(plza ? PLZA_EN : 0) | plza_value.full);
}
}
[Earlier e-mail about clearing the high half of MSR_IA32_PQR_PLZA_ASSOC
was wrong. My debug trace printed the wrong value. The argument to the
wrmsrl() is correct].
Got it. Thanks
Babu