Re: [RFC PATCH 16/19] fs/resctrl: Implement rdtgroup_plza_write() to configure PLZA in a group
From: Luck, Tony
Date: Wed Jan 28 2026 - 17:04:41 EST
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.