public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Luck, Tony" <tony.luck@intel.com>
To: Ben Horgan <ben.horgan@arm.com>
Cc: Reinette Chatre <reinette.chatre@intel.com>,
	"Moger, Babu" <bmoger@amd.com>,
	"Moger, Babu" <Babu.Moger@amd.com>,
	Drew Fustini <fustini@kernel.org>,
	"corbet@lwn.net" <corbet@lwn.net>,
	"Dave.Martin@arm.com" <Dave.Martin@arm.com>,
	"james.morse@arm.com" <james.morse@arm.com>,
	"tglx@kernel.org" <tglx@kernel.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"bp@alien8.de" <bp@alien8.de>,
	"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
	"x86@kernel.org" <x86@kernel.org>,
	"hpa@zytor.com" <hpa@zytor.com>,
	"peterz@infradead.org" <peterz@infradead.org>,
	"juri.lelli@redhat.com" <juri.lelli@redhat.com>,
	"vincent.guittot@linaro.org" <vincent.guittot@linaro.org>,
	"dietmar.eggemann@arm.com" <dietmar.eggemann@arm.com>,
	"rostedt@goodmis.org" <rostedt@goodmis.org>,
	"bsegall@google.com" <bsegall@google.com>,
	"mgorman@suse.de" <mgorman@suse.de>,
	"vschneid@redhat.com" <vschneid@redhat.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"pawan.kumar.gupta@linux.intel.com"
	<pawan.kumar.gupta@linux.intel.com>,
	"pmladek@suse.com" <pmladek@suse.com>,
	"feng.tang@linux.alibaba.com" <feng.tang@linux.alibaba.com>,
	"kees@kernel.org" <kees@kernel.org>,
	"arnd@arndb.de" <arnd@arndb.de>,
	"fvdl@google.com" <fvdl@google.com>,
	"lirongqing@baidu.com" <lirongqing@baidu.com>,
	"bhelgaas@google.com" <bhelgaas@google.com>,
	"seanjc@google.com" <seanjc@google.com>,
	"xin@zytor.com" <xin@zytor.com>,
	"Shukla, Manali" <Manali.Shukla@amd.com>,
	"dapeng1.mi@linux.intel.com" <dapeng1.mi@linux.intel.com>,
	"chang.seok.bae@intel.com" <chang.seok.bae@intel.com>,
	"Limonciello, Mario" <Mario.Limonciello@amd.com>,
	"naveen@kernel.org" <naveen@kernel.org>,
	"elena.reshetova@intel.com" <elena.reshetova@intel.com>,
	"Lendacky, Thomas" <Thomas.Lendacky@amd.com>,
	"linux-doc@vger.kernel.org" <linux-doc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"peternewman@google.com" <peternewman@google.com>,
	"eranian@google.com" <eranian@google.com>,
	"Shenoy, Gautham Ranjal" <gautham.shenoy@amd.com>
Subject: Re: [RFC PATCH 13/19] x86/resctrl: Add PLZA state tracking and context switch handling
Date: Wed, 11 Feb 2026 11:46:46 -0800	[thread overview]
Message-ID: <aYzcpuG0PfUaTdqt@agluck-desk3> (raw)
In-Reply-To: <aYyxAPdTFejzsE42@e134344.arm.com>

On Wed, Feb 11, 2026 at 04:40:32PM +0000, Ben Horgan wrote:
> Hi,
> 
> Thanks for including me.
> 
> On Tue, Feb 10, 2026 at 10:04:48AM -0800, Reinette Chatre wrote:
> > +Ben and Drew
> > 
> > On 2/10/26 8:17 AM, Reinette Chatre wrote:
> > > Hi Babu,
> > > 
> > > On 1/28/26 9:44 AM, Moger, Babu wrote:
> > >>
> > >>
> > >> On 1/28/2026 11:41 AM, Moger, Babu wrote:
> > >>>> On Wed, Jan 28, 2026 at 10:01:39AM -0600, Moger, Babu wrote:
> > >>>>> On 1/27/2026 4:30 PM, Luck, Tony wrote:
> > >>>> Babu,
> > >>>>
> > >>>> I've read a bit more of the code now and I think I understand more.
> > >>>>
> > >>>> Some useful additions to your explanation.
> > >>>>
> > >>>> 1) Only one CTRL group can be marked as PLZA
> > >>>
> > >>> Yes. Correct.
> > > 
> > > Why limit it to one CTRL_MON group and why not support it for MON groups?
> > > 
> > > Limiting it to a single CTRL group seems restrictive in a few ways:
> > > 1) It requires that the "PLZA" group has a dedicated CLOSID. This reduces the
> > >    number of use cases that can be supported. Consider, for example, an existing
> > >    "high priority" resource group and a "low priority" resource group. The user may
> > >    just want to let the tasks in the "low priority" resource group run as "high priority"
> > >    when in CPL0. This of course may depend on what resources are allocated, for example
> > >    cache may need more care, but if, for example, user is only interested in memory
> > >    bandwidth allocation this seems a reasonable use case?
> > > 2) Similar to what Tony [1] mentioned this does not enable what the hardware is
> > >    capable of in terms of number of different control groups/CLOSID that can be
> > >    assigned to MSR_IA32_PQR_PLZA_ASSOC. Why limit PLZA to one CLOSID?
> > > 3) The feature seems to support RMID in MSR_IA32_PQR_PLZA_ASSOC similar to
> > >    MSR_IA32_PQR_ASSOC. With this, it should be possible for user space to, for
> > >    example, create a resource group that contains tasks of interest and create
> > >    a monitor group within it that monitors all tasks' bandwidth usage when in CPL0.
> > >    This will give user space better insight into system behavior and from what I can
> > >    tell is supported by the feature but not enabled?
> > > 
> > >>>
> > >>>> 2) It can't be the root/default group
> > >>>
> > >>> This is something I added to keep the default group in a un-disturbed,
> > > 
> > > Why was this needed?
> > > 
> > >>>
> > >>>> 3) It can't have sub monitor groups
> > > 
> > > Why not?
> > > 
> > >>>> 4) It can't be pseudo-locked
> > >>>
> > >>> Yes.
> > >>>
> > >>>>
> > >>>> Would a potential use case involve putting *all* tasks into the PLZA group? That
> > >>>> would avoid any additional context switch overhead as the PLZA MSR would never
> > >>>> need to change.
> > >>>
> > >>> Yes. That can be one use case.
> > >>>
> > >>>>
> > >>>> If that is the case, maybe for the PLZA group we should allow user to
> > >>>> do:
> > >>>>
> > >>>> # echo '*' > tasks
> > > 
> > > Dedicating a resource group to "PLZA" seems restrictive while also adding many
> > > complications since this designation makes resource group behave differently and
> > > thus the files need to get extra "treatments" to handle this "PLZA" designation.
> > > 
> > > I am wondering if it will not be simpler to introduce just one new file, for example
> > > "tasks_cpl0" in both CTRL_MON and MON groups. When user space writes a task ID to the
> > > file it "enables" PLZA for this task and that group's CLOSID and RMID is the associated
> > > task's "PLZA" CLOSID and RMID. This gives user space the flexibility to use the same
> > > resource group to manage user space and kernel space allocations while also supporting
> > > various monitoring use cases. This still supports the "dedicate a resource group to PLZA"
> > > use case where user space can create a new resource group with certain allocations but the
> > > "tasks" file will be empty and "tasks_cpl0" contains the tasks needing to run with
> > > the resource group's allocations when in CPL0.
> 
> If there is a "tasks_cpl0"  then I'd expect a "cpus_cpl0" too.
> 
> > 
> > It looks like MPAM has a few more capabilities here and the Arm levels are numbered differently
> > with EL0 meaning user space. We should thus aim to keep things as generic as possible. For example,
> > instead of CPL0 using something like "kernel" or ... ?
> 
> Yes, PLZA does open up more possibilities for MPAM usage.  I've talked to James
> internally and here are a few thoughts.
> 
> If the user case is just that an option run all tasks with the same closid/rmid
> (partid/pmg) configuration when they are running in the kernel then I'd favour a
> mount option. The resctrl filesytem interface doesn't need to change and
> userspace software doesn't need to change. This could either take away a
> closid/rmid from userspace and dedicate it to the kernel or perhaps have a
> policy to have the default group as the kernel group. If you use the default
> configuration, at least for MPAM, the kernel may not be running at the highest
> priority as a minimum bandwidth can be used to give a priority boost. (Once we
> have a resctrl schema for this.)

I'm a big fan of this use case. It's easy to understand why users would
want this. It avoids the issue that syscalls, page-faults, and
interrupts from a task with very limited resources will spend ages in
the kernel. Users have complained about the priority inversions that
this can cause.

It also has a simpler implementation. No changes to the context switch
code. On x86 some simple method to steal a CLOSID and configure
resources for that CLOSID.
> 
> It could be useful to have something a bit more featureful though. Is there a

Many things have theoretical use cases. I'd like to hear from some
resctrl users whether they will make use of these extra features.

Babu's RFC allows for some tasks to be in the PLZA group while others
will run in kernel mode with the same resources that are granted to
the CTRL group they belong too.

Reinette asked[1] whether the PLZA mode should be extended to multiple
CTRL groups and their child CTRL_MON groups for even greater
flexibility.

[1] https://lore.kernel.org/all/7a4ea07d-88e6-4f0f-a3ce-4fd97388cec4@intel.com/

> need for the two mappings, task->cpl0 config and task->cpl1 to be independent or
> would as task->(cp0 config, cp1 config) be sufficient? It seems awkward that
> it's not a single write to move a task. If a single mapping is sufficient, then
> as single new file, kernel_group,per CTRL_MON group (maybe MON groups) as
> suggested above but rather than a task that file could hold a path to the
> CTRL_MON/MON group that provides the kernel configuraion for tasks running in
> that group. So that this can be transparent to existing software an empty string
> can mean use the current group's when in the kernel (as well as for
> userspace). A slash, /, could be used to refer to the default group. This would
> give something like the below under /sys/fs/resctrl.
> 
> .
> ├── cpus
> ├── tasks
> ├── ctrl1
> │   ├── cpus
> │   ├── kernel_group -> mon_groups/mon1
> │   └── tasks
> ├── kernel_group -> ctrl1
> └── mon_groups
>     └── mon1
>         ├── cpus
>         ├── kernel_group -> ctrl1
>         └── tasks
> 
> > 
> > I have not read anything about the RISC-V side of this yet.
> > 
> > Reinette
> > 
> > > 
> > > Reinette
> > > 
> > > [1] https://lore.kernel.org/lkml/aXpgragcLS2L8ROe@agluck-desk3/
> > 
> 
> Thanks,
> 
> Ben

-Tony

  reply	other threads:[~2026-02-11 19:46 UTC|newest]

Thread overview: 114+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-21 21:12 [RFC PATCH 00/19] x86,fs/resctrl: Support for Global Bandwidth Enforcement and Priviledge Level Zero Association Babu Moger
2026-01-21 21:12 ` [RFC PATCH 01/19] x86,fs/resctrl: Add support for Global Bandwidth Enforcement (GLBE) Babu Moger
2026-02-09 18:44   ` Reinette Chatre
2026-02-11  1:07     ` Moger, Babu
2026-02-11 16:54       ` Reinette Chatre
2026-02-11 21:18         ` Babu Moger
2026-02-12  3:51           ` Reinette Chatre
2026-02-12 19:09             ` Babu Moger
2026-02-13  0:05               ` Reinette Chatre
2026-02-13  1:51                 ` Moger, Babu
2026-02-13 16:17                   ` Reinette Chatre
2026-02-13 23:14                     ` Moger, Babu
2026-02-14  0:01                       ` Reinette Chatre
2026-02-16 16:05                         ` Babu Moger
2026-02-20 10:07             ` Ben Horgan
2026-02-20 18:39               ` Reinette Chatre
2026-02-23  9:29                 ` Ben Horgan
2026-02-21  0:12               ` Moger, Babu
2026-02-23 13:21             ` Fenghua Yu
2026-02-23 17:38               ` Reinette Chatre
2026-02-23 13:21             ` Fenghua Yu
2026-01-21 21:12 ` [RFC PATCH 02/19] x86,fs/resctrl: Add the resource for Global Memory Bandwidth Allocation Babu Moger
2026-01-21 21:12 ` [RFC PATCH 03/19] fs/resctrl: Add new interface max_bandwidth Babu Moger
2026-02-06 23:58   ` Reinette Chatre
2026-02-09 23:52     ` Moger, Babu
2026-01-21 21:12 ` [RFC PATCH 04/19] fs/resctrl: Add the documentation for Global Memory Bandwidth Allocation Babu Moger
2026-02-03  0:00   ` Luck, Tony
2026-02-03 16:38     ` Babu Moger
2026-02-09 16:32       ` Reinette Chatre
2026-02-10 19:44         ` Babu Moger
2026-01-21 21:12 ` [RFC PATCH 05/19] x86,fs/resctrl: Add support for Global Slow Memory Bandwidth Allocation (GSMBA) Babu Moger
2026-01-21 21:12 ` [RFC PATCH 06/19] x86,fs/resctrl: Add the resource for Global Slow Memory Bandwidth Enforcement(GLSBE) Babu Moger
2026-01-21 21:12 ` [RFC PATCH 07/19] fs/resctrl: Add the documentation for Global Slow Memory Bandwidth Allocation Babu Moger
2026-01-21 21:12 ` [RFC PATCH 08/19] x86/resctrl: Support Privilege-Level Zero Association (PLZA) Babu Moger
2026-01-21 21:12 ` [RFC PATCH 09/19] x86/resctrl: Add plza_capable in rdt_resource data structure Babu Moger
2026-02-11 15:19   ` Ben Horgan
2026-02-11 16:54     ` Reinette Chatre
2026-02-11 17:48       ` Ben Horgan
2026-02-13 15:50     ` Moger, Babu
2026-01-21 21:12 ` [RFC PATCH 10/19] fs/resctrl: Expose plza_capable via control info file Babu Moger
2026-01-21 21:12 ` [RFC PATCH 11/19] resctrl: Introduce PLZA static key enable/disable helpers Babu Moger
2026-01-21 21:12 ` [RFC PATCH 12/19] x86/resctrl: Add data structures and definitions for PLZA configuration Babu Moger
2026-01-21 21:12 ` [RFC PATCH 13/19] x86/resctrl: Add PLZA state tracking and context switch handling Babu Moger
2026-01-27 22:30   ` Luck, Tony
2026-01-28 16:01     ` Moger, Babu
2026-01-28 17:12       ` Luck, Tony
2026-01-28 17:41         ` Moger, Babu
2026-01-28 17:44           ` Moger, Babu
2026-01-28 19:17             ` Luck, Tony
2026-02-10 16:17             ` Reinette Chatre
2026-02-10 18:04               ` Reinette Chatre
2026-02-11 16:40                 ` Ben Horgan
2026-02-11 19:46                   ` Luck, Tony [this message]
2026-02-11 22:22                   ` Reinette Chatre
2026-02-12 13:55                     ` Ben Horgan
2026-02-12 18:37                       ` Reinette Chatre
2026-02-16 15:18                         ` Ben Horgan
2026-02-17 18:51                           ` Reinette Chatre
2026-02-17 21:44                             ` Luck, Tony
2026-02-17 22:37                               ` Reinette Chatre
2026-02-17 22:52                                 ` Luck, Tony
2026-02-17 23:55                                   ` Reinette Chatre
2026-02-18 16:44                                     ` Luck, Tony
2026-02-19 17:03                                       ` Luck, Tony
2026-02-19 17:45                                         ` Ben Horgan
2026-02-20  8:21                                         ` Drew Fustini
2026-02-19 17:33                                       ` Ben Horgan
2026-02-20  2:53                                       ` Reinette Chatre
2026-02-20 22:44                                         ` Moger, Babu
2026-02-23 17:12                                           ` Reinette Chatre
2026-02-23 22:35                                             ` Moger, Babu
2026-02-23 23:13                                               ` Reinette Chatre
2026-02-24 19:37                                                 ` Babu Moger
2026-02-23 10:08                                         ` Ben Horgan
2026-02-23 16:38                                           ` Reinette Chatre
2026-02-24  9:36                                             ` Ben Horgan
2026-02-24 16:13                                               ` Reinette Chatre
2026-02-19 11:06                               ` Ben Horgan
2026-02-19 18:12                                 ` Luck, Tony
2026-02-19 18:36                                   ` Reinette Chatre
2026-02-19 10:21                             ` Ben Horgan
2026-02-19 18:14                               ` Reinette Chatre
2026-02-23  9:48                                 ` Ben Horgan
2026-02-13 16:37               ` Moger, Babu
2026-02-13 17:02                 ` Luck, Tony
2026-02-16 19:24                   ` Babu Moger
2026-02-14  0:10                 ` Reinette Chatre
2026-02-16 15:41                   ` Ben Horgan
2026-02-16 22:52                     ` Moger, Babu
2026-02-17 15:56                       ` Ben Horgan
2026-02-17 16:38                         ` Babu Moger
2026-02-18  9:54                           ` Ben Horgan
2026-02-18  6:22                         ` Stephane Eranian
2026-02-18  9:35                           ` Ben Horgan
2026-02-19 10:27                             ` Ben Horgan
2026-02-16 22:36                   ` Moger, Babu
2026-02-12 10:00       ` Ben Horgan
2026-01-21 21:12 ` [RFC PATCH 14/19] x86,fs/resctrl: Add the functionality to configure PLZA Babu Moger
2026-01-29 19:13   ` Luck, Tony
2026-01-29 19:53     ` Babu Moger
2026-01-21 21:12 ` [RFC PATCH 15/19] fs/resctrl: Introduce PLZA attribute in rdtgroup interface Babu Moger
2026-01-21 21:12 ` [RFC PATCH 16/19] fs/resctrl: Implement rdtgroup_plza_write() to configure PLZA in a group Babu Moger
2026-01-28 22:03   ` Luck, Tony
2026-01-29 18:54     ` Luck, Tony
2026-01-29 19:31       ` Babu Moger
2026-01-29 19:42     ` Babu Moger
2026-02-10  0:05   ` Reinette Chatre
2026-02-11 23:10     ` Moger, Babu
2026-01-21 21:12 ` [RFC PATCH 17/19] fs/resctrl: Update PLZA configuration when cpu_mask changes Babu Moger
2026-01-21 21:12 ` [RFC PATCH 18/19] x86/resctrl: Refactor show_rdt_tasks() to support PLZA task matching Babu Moger
2026-01-21 21:12 ` [RFC PATCH 19/19] fs/resctrl: Add per-task PLZA enable support via rdtgroup Babu Moger
2026-02-03 19:58 ` [RFC PATCH 00/19] x86,fs/resctrl: Support for Global Bandwidth Enforcement and Priviledge Level Zero Association Luck, Tony
2026-02-10  0:27   ` Reinette Chatre
2026-02-11  0:40     ` Drew Fustini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aYzcpuG0PfUaTdqt@agluck-desk3 \
    --to=tony.luck@intel.com \
    --cc=Babu.Moger@amd.com \
    --cc=Dave.Martin@arm.com \
    --cc=Manali.Shukla@amd.com \
    --cc=Mario.Limonciello@amd.com \
    --cc=Thomas.Lendacky@amd.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=ben.horgan@arm.com \
    --cc=bhelgaas@google.com \
    --cc=bmoger@amd.com \
    --cc=bp@alien8.de \
    --cc=bsegall@google.com \
    --cc=chang.seok.bae@intel.com \
    --cc=corbet@lwn.net \
    --cc=dapeng1.mi@linux.intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=elena.reshetova@intel.com \
    --cc=eranian@google.com \
    --cc=feng.tang@linux.alibaba.com \
    --cc=fustini@kernel.org \
    --cc=fvdl@google.com \
    --cc=gautham.shenoy@amd.com \
    --cc=hpa@zytor.com \
    --cc=james.morse@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=kees@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lirongqing@baidu.com \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=naveen@kernel.org \
    --cc=pawan.kumar.gupta@linux.intel.com \
    --cc=peternewman@google.com \
    --cc=peterz@infradead.org \
    --cc=pmladek@suse.com \
    --cc=reinette.chatre@intel.com \
    --cc=rostedt@goodmis.org \
    --cc=seanjc@google.com \
    --cc=tglx@kernel.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    --cc=x86@kernel.org \
    --cc=xin@zytor.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox