Re: [PATCH v6 3/6] fs/resctrl: Clear the CDP state after the cleanup
From: Reinette Chatre
Date: Mon Nov 23 2026 - 18:29:28 EST
Hi Jinjie,
On 11/19/26 1:48 AM, Jinjie Ruan wrote:
> To support CDP, resctrl halves the number of CLOSIDs available to
> resource groups and gives each remaining CLOSID two hardware
> configurations instead of one, distinguished by index: 2 * CLOSID for
> data and 2 * CLOSID + 1 for code. Without CDP a CLOSID has a single
> configuration, at index CLOSID. Every architecture computes these
> indices the same way.
>
> Unmounting clears the CDP state before it undoes what the groups were
> given, so the cleanup computes index CLOSID where the group was set up
> with 2 * CLOSID and 2 * CLOSID + 1. The group's two configurations are
> left in place and index CLOSID is cleared instead, which with CDP
> enabled is a configuration of a different CLOSID. The architecture may
> keep this state for as long as the resource exists.
>
> Only MPAM can reach this today. Of everything the cleanup has to undo,
> MPAM addresses only the MBM counter assignment by the translated CLOSID,
> and it only began doing so when it implemented assignable counters. x86
> addresses its counters by RMID alone.
>
> Clear the CDP state after the cleanup, so that the cleanup runs with the
> CDP state the groups were set up under.
>
> Fixes: 6e0e538a75ce ("arm_mpam: resctrl: Add resctrl_arch_config_cntr() for ABMC use")
> Signed-off-by: Jinjie Ruan <ruanjinjie@xxxxxxxxxx>
> Cc: <stable@xxxxxxxxxxxxxxx>
> ---
Thank you.
Reviewed-by: Reinette Chatre <reinette.chatre@xxxxxxxxx>
Reinette