[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aXqHs0Mm5F9_R4Q6@agluck-desk3>
Date: Wed, 28 Jan 2026 14:03:31 -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 16/19] fs/resctrl: Implement rdtgroup_plza_write() to
configure PLZA in a group
On Wed, Jan 21, 2026 at 03:12:54PM -0600, Babu Moger wrote:
> Introduce rdtgroup_plza_write() group which enables per group control of
> PLZA through the resctrl filesystem and ensure that enabling or disabling
> PLZA is propagated consistently across all CPUs belonging to the group.
>
> Enforce the capability checks, exclude default, pseudo-locked and CTRL_MON
> groups with sub monitors. Also, ensure that only one group can have PLZA
> enabled at a time.
>
...
> +static ssize_t rdtgroup_plza_write(struct kernfs_open_file *of, char *buf,
> + size_t nbytes, loff_t off)
> +{
> + struct rdt_resource *r = resctrl_arch_get_resource(RDT_RESOURCE_L3);
> + struct rdtgroup *rdtgrp, *prgrp;
> + int cpu, ret = 0;
> + bool enable;
...
> + /* Enable or disable PLZA state and update per CPU state if there is a change */
> + if (enable != rdtgrp->plza) {
> + resctrl_arch_plza_setup(r, rdtgrp->closid, rdtgrp->mon.rmid);
What is this for? If I've just created a group with no tasks, and empty
CPU mask ... it seems that this writes the MSR_IA32_PQR_PLZA_ASSOC on
every CPU in every domain.
> + for_each_cpu(cpu, &rdtgrp->cpu_mask)
> + resctrl_arch_set_cpu_plza(cpu, rdtgrp->closid,
> + rdtgrp->mon.rmid, enable);
> + rdtgrp->plza = enable;
> + }
> +
> +unlock:
> + rdtgroup_kn_unlock(of->kn);
> +
> + return ret ?: nbytes;
> +}
It also appears that marking a task as PLZA is permanent. Moving it to
another group doesn't unmark it. Is this intentional?
# mkdir group1 group2 plza_group
# echo 1 > plza_group/plza
# echo $$ > group1/tasks
# echo $$ > plza_group/tasks
My shell is now in group1 and in the plza_group
# grep $$ */tasks
group1/tasks:4125
plza_group/tasks:4125
Move shell to group2
# echo $$ > group2/tasks
# grep $$ */tasks
group2/tasks:4125
plza_group/tasks:4125
Succcess in moving to group2, but still in plza_group
-Tony
N.B. I don't have a PLZA enabled system. So I faked it with this
patch.
>From 1655fea0049947218fa5400916d57109be8521ef Mon Sep 17 00:00:00 2001
From: Tony Luck <tony.luck@...el.com>
Date: Wed, 28 Jan 2026 13:02:51 -0800
Subject: [PATCH] fake PLZA
---
arch/x86/include/asm/resctrl.h | 10 ++++++----
arch/x86/kernel/cpu/resctrl/core.c | 4 ++--
arch/x86/kernel/cpu/resctrl/ctrlmondata.c | 3 ++-
3 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/arch/x86/include/asm/resctrl.h b/arch/x86/include/asm/resctrl.h
index 2c11787c5253..7ee35bebb64c 100644
--- a/arch/x86/include/asm/resctrl.h
+++ b/arch/x86/include/asm/resctrl.h
@@ -90,14 +90,16 @@ static inline void resctrl_arch_disable_mon(void)
static inline void resctrl_arch_enable_plza(void)
{
- static_branch_enable_cpuslocked(&rdt_plza_enable_key);
- static_branch_inc_cpuslocked(&rdt_enable_key);
+ pr_info("resctrl_arch_enable_plza\n");
+ //static_branch_enable_cpuslocked(&rdt_plza_enable_key);
+ //static_branch_inc_cpuslocked(&rdt_enable_key);
}
static inline void resctrl_arch_disable_plza(void)
{
- static_branch_disable_cpuslocked(&rdt_plza_enable_key);
- static_branch_dec_cpuslocked(&rdt_enable_key);
+ pr_info("resctrl_arch_disable_plza\n");
+ //static_branch_disable_cpuslocked(&rdt_plza_enable_key);
+ //static_branch_dec_cpuslocked(&rdt_enable_key);
}
/*
diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c
index e41fe5fa3f30..780cdfb0e7cd 100644
--- a/arch/x86/kernel/cpu/resctrl/core.c
+++ b/arch/x86/kernel/cpu/resctrl/core.c
@@ -295,7 +295,7 @@ static __init bool __rdt_get_mem_config_amd(struct rdt_resource *r)
r->alloc_capable = true;
- if (rdt_cpu_has(X86_FEATURE_PLZA))
+ if (1 || rdt_cpu_has(X86_FEATURE_PLZA))
r->plza_capable = true;
return true;
@@ -318,7 +318,7 @@ static void rdt_get_cache_alloc_cfg(int idx, struct rdt_resource *r)
r->cache.arch_has_sparse_bitmasks = ecx.split.noncont;
r->alloc_capable = true;
- if (rdt_cpu_has(X86_FEATURE_PLZA))
+ if (1 || rdt_cpu_has(X86_FEATURE_PLZA))
r->plza_capable = true;
}
diff --git a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
index 79ed41bde810..24a37ebed13a 100644
--- a/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
+++ b/arch/x86/kernel/cpu/resctrl/ctrlmondata.c
@@ -136,7 +136,8 @@ static void resctrl_plza_set_one_amd(void *arg)
{
union qos_pqr_plza_assoc *plza = arg;
- wrmsrl(MSR_IA32_PQR_PLZA_ASSOC, plza->full);
+ pr_info("wrmsr(MSR_IA32_PQR_PLZA_ASSOC, 0x%lx)\n", plza->full);
+ //wrmsrl(MSR_IA32_PQR_PLZA_ASSOC, plza->full);
}
void resctrl_arch_plza_setup(struct rdt_resource *r, u32 closid, u32 rmid)
--
2.52.0
Powered by blists - more mailing lists