Re: [RFC PATCH 16/19] fs/resctrl: Implement rdtgroup_plza_write() to configure PLZA in a group
From: Babu Moger
Date: Thu Jan 29 2026 - 14:42:48 EST
Hi Tony,
On 1/28/26 16:03, Luck, Tony wrote:
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 */What is this for? If I've just created a group with no tasks, and empty
+ if (enable != rdtgrp->plza) {
+ resctrl_arch_plza_setup(r, rdtgrp->closid, rdtgrp->mon.rmid);
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)It also appears that marking a task as PLZA is permanent. Moving it to
+ resctrl_arch_set_cpu_plza(cpu, rdtgrp->closid,
+ rdtgrp->mon.rmid, enable);
+ rdtgrp->plza = enable;
+ }
+
+unlock:
+ rdtgroup_kn_unlock(of->kn);
+
+ return ret ?: nbytes;
+}
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
You are moving the task from group1 to group2. This basically changes the association in
MSR_IA32_PQR_ASSOC register, It does not change the PLZA association.
To change it:
a. You either remove task from plza group which triggers task update (tsk->plza = 0)
echo >> /sys/fs/resctrl/plza_group/tasks
b. Or you can change the group as regular group.
echo 0 > /sys/fs/resctrl/plza_group/plza
Thanks for the trying it out.
- Babu