[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aXuxVSbk1GR2ttzF@agluck-desk3>
Date: Thu, 29 Jan 2026 11:13:25 -0800
From: "Luck, Tony" <tony.luck@...el.com>
To: Babu Moger <babu.moger@....com>
CC: <corbet@....net>, <reinette.chatre@...el.com>, <Dave.Martin@....com>,
<james.morse@....com>, <tglx@...nel.org>, <mingo@...hat.com>, <bp@...en8.de>,
<dave.hansen@...ux.intel.com>, <x86@...nel.org>, <hpa@...or.com>,
<peterz@...radead.org>, <juri.lelli@...hat.com>,
<vincent.guittot@...aro.org>, <dietmar.eggemann@....com>,
<rostedt@...dmis.org>, <bsegall@...gle.com>, <mgorman@...e.de>,
<vschneid@...hat.com>, <akpm@...ux-foundation.org>,
<pawan.kumar.gupta@...ux.intel.com>, <pmladek@...e.com>,
<feng.tang@...ux.alibaba.com>, <kees@...nel.org>, <arnd@...db.de>,
<fvdl@...gle.com>, <lirongqing@...du.com>, <bhelgaas@...gle.com>,
<seanjc@...gle.com>, <xin@...or.com>, <manali.shukla@....com>,
<dapeng1.mi@...ux.intel.com>, <chang.seok.bae@...el.com>,
<mario.limonciello@....com>, <naveen@...nel.org>,
<elena.reshetova@...el.com>, <thomas.lendacky@....com>,
<linux-doc@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<kvm@...r.kernel.org>, <peternewman@...gle.com>, <eranian@...gle.com>,
<gautham.shenoy@....com>
Subject: Re: [RFC PATCH 14/19] x86,fs/resctrl: Add the functionality to
configure PLZA
On Wed, Jan 21, 2026 at 03:12:52PM -0600, Babu Moger wrote:
> Privilege Level Zero Association (PLZA) is configured by writing to
> 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.
Architecturally this is true. But in the implementation for resctrl
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
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].
-Tony
Powered by blists - more mailing lists