Re: [PATCH v9 05/10] fs/resctrl: Introduce interface to display "io_alloc" support

From: Reinette Chatre

Date: Thu Sep 18 2025 - 01:28:28 EST


Hi Babu,

On 9/2/25 3:41 PM, Babu Moger wrote:
> "io_alloc" feature in resctrl allows direct insertion of data from I/O
> devices into the cache.
>
> Introduce the 'io_alloc' resctrl file to indicate the support for the
> feature.

Changelog that aims to address feeback received in ABMC series (avoid repetition
and document any non-obvious things), please feel free to improve:

Introduce the "io_alloc" resctrl file to the "info" area of a cache
resource, for example /sys/fs/resctrl/info/L3/io_alloc. "io_alloc"
indicates support for the "io_alloc" feature that allows direct
insertion of data from I/O devices into the cache.

Restrict exposing support for "io_alloc" to the L3 resource that is the
only resource where this feature can be backed by AMD's L3 Smart Data Cache
Injection Allocation Enforcement (SDCIAE). With that, the "io_alloc" file is only
visible to user space if the L3 resource supports "io_alloc". Doing
so makes the file visible for all cache resources though, for example also L2
cache (if it supports cache allocation). As a consequence, add capability for
file to report expected "enabled" and "disabled", as well as "not supported".


>
> Signed-off-by: Babu Moger <babu.moger@xxxxxxx>
> ---

...

> ---
> Documentation/filesystems/resctrl.rst | 30 +++++++++++++++++++++++++++
> fs/resctrl/ctrlmondata.c | 21 +++++++++++++++++++
> fs/resctrl/internal.h | 5 +++++
> fs/resctrl/rdtgroup.c | 24 ++++++++++++++++++++-
> 4 files changed, 79 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/filesystems/resctrl.rst b/Documentation/filesystems/resctrl.rst
> index 4866a8a4189f..89aab17b00cb 100644
> --- a/Documentation/filesystems/resctrl.rst
> +++ b/Documentation/filesystems/resctrl.rst
> @@ -136,6 +136,36 @@ related to allocation:
> "1":
> Non-contiguous 1s value in CBM is supported.
>
> +"io_alloc":
> + "io_alloc" enables system software to configure the portion of
> + the cache allocated for I/O traffic. File may only exist if the
> + system supports this feature on some of its cache resources.
> +
> + "disabled":
> + Resource supports "io_alloc" but the feature is disabled.
> + Portions of cache used for allocation of I/O traffic cannot
> + be configured.
> + "enabled":
> + Portions of cache used for allocation of I/O traffic
> + can be configured using "io_alloc_cbm".
> + "not supported":
> + Support not available for this resource.
> +

After trying to rework the changelogs I believe the portion of doc below is better suited for
the next patch that adds support for enable/disable where CLOSIDs are relevant.

> + The underlying implementation may reduce resources available to
> + general (CPU) cache allocation. See architecture specific notes
> + below. Depending on usage requirements the feature can be enabled
> + or disabled.
> +
> + On AMD systems, io_alloc feature is supported by the L3 Smart
> + Data Cache Injection Allocation Enforcement (SDCIAE). The CLOSID for
> + io_alloc is the highest CLOSID supported by the resource. When
> + io_alloc is enabled, the highest CLOSID is dedicated to io_alloc and
> + no longer available for general (CPU) cache allocation. When CDP is
> + enabled, io_alloc routes I/O traffic using the highest CLOSID allocated
> + for the instruction cache (L3CODE), making this CLOSID no longer
> + available for general (CPU) cache allocation for both the L3CODE and
> + L3DATA resources.
> +
> Memory bandwidth(MB) subdirectory contains the following files
> with respect to allocation:
>

Reinette