[RFC PATCH 00/19] x86,fs/resctrl: Support for Global Bandwidth Enforcement and Priviledge Level Zero Association

Babu Moger posted 19 patches 2 weeks, 2 days ago
.../admin-guide/kernel-parameters.txt         |   2 +-
Documentation/filesystems/resctrl.rst         | 110 ++++++-
arch/x86/include/asm/cpufeatures.h            |   4 +-
arch/x86/include/asm/msr-index.h              |   9 +
arch/x86/include/asm/resctrl.h                |  44 +++
arch/x86/kernel/cpu/resctrl/core.c            |  89 +++++-
arch/x86/kernel/cpu/resctrl/ctrlmondata.c     |  25 ++
arch/x86/kernel/cpu/resctrl/internal.h        |  26 ++
arch/x86/kernel/cpu/resctrl/rdtgroup.c        |   7 +
arch/x86/kernel/cpu/scattered.c               |   3 +
fs/resctrl/ctrlmondata.c                      |   5 +-
fs/resctrl/internal.h                         |   2 +
fs/resctrl/rdtgroup.c                         | 301 +++++++++++++++++-
include/linux/resctrl.h                       |  16 +
include/linux/sched.h                         |   1 +
15 files changed, 623 insertions(+), 21 deletions(-)
[RFC PATCH 00/19] x86,fs/resctrl: Support for Global Bandwidth Enforcement and Priviledge Level Zero Association
Posted by Babu Moger 2 weeks, 2 days ago
This patch series adds support for Global Bandwidth Enforcement (GLBE),
Global Slow Bandwidth Enforcement (GLSBE) and Priviledge Level Zero
Association (PLZA) in the x86 architecture's fs/resctrl subsystem. The
changes include modifications to the resctrl filesystem to allow users to
configure GLBE settings and associate CPUs and tasks with a separate CLOS
when executiing in CPL0.

The feature documentation is not yet publicly available, but it is expected
to be released in the next few weeks. In the meantime, a brief description
of the features is provided below. Sharing this series as an RFC to gather
initial feedback. Comments are welcome.

Global Bandwidth Enforcement (GLBE) 

AMD Global Bandwidth Enforcement (GLBE) provides a mechanism for software
to specify bandwidth limits for groups of threads that span multiple QOoS
Domains. This collection of QOS Domains is referred to as the GLBE Control
Domain.  The GLBE ceiling is a bandwidth ceiling for L3 External Bandwidth
competitively shared between all threads in a COS (Class of Service) across
all QOS Domains within the GLBE Control Domain.  This complements L3BE L3
External Bandwidth Enforcement (L3BE) which provides L3 eExternal Bandwidth
control on a per QOS Domain granularity.  

Global Slow Bandwidth Enforcement (GLSBE) 

AMD PQoS Global Slow Bandwidth Enforcement (GLSBE) provides a mechanism for
software to specify bandwidth limits for groups of threads that span
multiple QOS Domains. GLSBE operates within the same GLBE Control Domains
defined by GLBE.  The GLSBE ceiling is a bandwidth ceiling for L3 External
Bandwidth to Slow Memory competitively shared between all threads in a COS
in all QOS Domains within the GLBE Control Domain.  This complements L3SMBE
which provides Slow Memory bandwidth control on a per QOS Domain
granularity.  
 
Privilege Level Zero Association (PLZA) 

Privilege Level Zero Association (PLZA) allows the hardware to
automatically associate execution in Privilege Level Zero (CPL=0) with a
specific COS (Class of Service) and/or RMID (Resource Monitoring
Identifier). The QoS feature set already has a mechanism to associate
execution on each logical processor with an RMID or COS. PLZA allows the
system to override this per-thread association for a thread that is
executing with CPL=0. 

The patches are based on top of commit (v6.19-rc5)
Commit 0f61b1860cc3 (tag: v6.19-rc5, tip/tip/urgent) Linux 6.19-rc5
 
Changes include:        
 - Introduction of a new max_bandwidth file for each resctrl resource to
   expose the maximum supported bandwidth.
 - Addition of new schemata GMB and GSMBA interfaces for configuring GLBE
   and GSLBE parameters.
 - Modifications to associate resctrl groups with PLZA.
 - Documentation updates to describe the new functionality.

Interface Changes:
1. A new max_bandwidth file has been added under each resource type
   directory (for example, /sys/fs/resctrl/info/GMB/max_bandwidth) to
   report the maximum bandwidth supported by the resource.

2. New resource types, GMB and GSMBA, have been introduced and are exposed
   through the schemata interface:
   # cat /sys/fs/resctrl/schemata
     GSMBA:0=4096;1=4096
      SMBA:0=8192;1=8192
       GMB:0=4096;1=4096
        MB:0=8192;1=8192
        L3:0=ffff;1=ffff

3. A new plza_capable file has been added under each resource type directory
  (for example, /sys/fs/resctrl/info/GMB/plza_capable) to indicate whether
   the resource supports the PLZA feature.

4. A new plza control file has been added to each resctrl group (for example,
  /sys/fs/resctrl/plza) to enable or disable PLZA association for the group.
  Writing 1 enables PLZA for the group, while writing 0 disables it.


Babu Moger (19):
  x86,fs/resctrl: Add support for Global Bandwidth Enforcement (GLBE)
  x86,fs/resctrl: Add the resource for Global Memory Bandwidth
    Allocation
  fs/resctrl: Add new interface max_bandwidth
  fs/resctrl: Add the documentation for Global Memory Bandwidth
    Allocation
  x86,fs/resctrl: Add support for Global Slow Memory Bandwidth
    Allocation (GSMBA)
  x86,fs/resctrl: Add the resource for Global Slow Memory Bandwidth
    Enforcement(GLSBE)
  fs/resctrl: Add the documentation for Global Slow Memory Bandwidth
    Allocation
  x86/resctrl: Support Privilege-Level Zero Association (PLZA)
  x86/resctrl: Add plza_capable in rdt_resource data structure
  fs/resctrl: Expose plza_capable via control info file
  resctrl: Introduce PLZA static key enable/disable helpers
  x86/resctrl: Add data structures and definitions for PLZA
    configuration
  x86/resctrl: Add PLZA state tracking and context switch handling
  x86,fs/resctrl: Add the functionality to configure PLZA
  fs/resctrl: Introduce PLZA attribute in rdtgroup interface
  fs/resctrl: Implement rdtgroup_plza_write() to configure PLZA in a
    group
  fs/resctrl: Update PLZA configuration when cpu_mask changes
  x86/resctrl: Refactor show_rdt_tasks() to support PLZA task matching
  fs/resctrl: Add per-task PLZA enable support via rdtgroup

 .../admin-guide/kernel-parameters.txt         |   2 +-
 Documentation/filesystems/resctrl.rst         | 110 ++++++-
 arch/x86/include/asm/cpufeatures.h            |   4 +-
 arch/x86/include/asm/msr-index.h              |   9 +
 arch/x86/include/asm/resctrl.h                |  44 +++
 arch/x86/kernel/cpu/resctrl/core.c            |  89 +++++-
 arch/x86/kernel/cpu/resctrl/ctrlmondata.c     |  25 ++
 arch/x86/kernel/cpu/resctrl/internal.h        |  26 ++
 arch/x86/kernel/cpu/resctrl/rdtgroup.c        |   7 +
 arch/x86/kernel/cpu/scattered.c               |   3 +
 fs/resctrl/ctrlmondata.c                      |   5 +-
 fs/resctrl/internal.h                         |   2 +
 fs/resctrl/rdtgroup.c                         | 301 +++++++++++++++++-
 include/linux/resctrl.h                       |  16 +
 include/linux/sched.h                         |   1 +
 15 files changed, 623 insertions(+), 21 deletions(-)

-- 
2.34.1
Re: [RFC PATCH 00/19] x86,fs/resctrl: Support for Global Bandwidth Enforcement and Priviledge Level Zero Association
Posted by Luck, Tony 3 days, 18 hours ago
On Wed, Jan 21, 2026 at 03:12:38PM -0600, Babu Moger wrote:
> Privilege Level Zero Association (PLZA) 
> 
> Privilege Level Zero Association (PLZA) allows the hardware to
> automatically associate execution in Privilege Level Zero (CPL=0) with a
> specific COS (Class of Service) and/or RMID (Resource Monitoring
> Identifier). The QoS feature set already has a mechanism to associate
> execution on each logical processor with an RMID or COS. PLZA allows the
> system to override this per-thread association for a thread that is
> executing with CPL=0. 

Adding Drew, and prodding Dave & James, for this discussion.

At LPC it was stated that both ARM and RISC-V already have support
to run kernel code with different quality of service parameters from
user code.

I'm thinking that Babu's implementation for resctrl may be over
engineered. Specifically the part that allows users to put some
tasks into the PLZA group, while leaving others in a mode where
kernel code runs with same QoS parameters as user code.

That comes at a cost of complexity, and performance in the context
switch code.

But maybe I'm missing some practical case where users want that
behaviour.

-Tony