[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <57d7a46a-c3d6-4c7c-bed1-ee61d6d690fb@amd.com>
Date: Thu, 29 Jan 2026 13:42:24 -0600
From: Babu Moger <bmoger@....com>
To: "Luck, Tony" <tony.luck@...el.com>, 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
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 */
>> + 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
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
Powered by blists - more mailing lists