Re: [PATCH v6 4/6] fs/resctrl: Stop the limbo handler while resctrl is unmounted
From: Reinette Chatre
Date: Mon Nov 23 2026 - 18:29:39 EST
Hi Jinjie,
On 11/19/26 1:48 AM, Jinjie Ruan wrote:
> A monitoring group's RMID is not returned to the free list when the
> group is removed. It stays in limbo until the cache occupancy still
> counted against it has dropped low enough for the RMID to be reused,
> which the limbo handler checks once a second.
>
> The limbo handler keeps running after resctrl is unmounted, where there
> is nothing for it to achieve. An RMID is only allocated when a group is
> created, which needs resctrl to be mounted, so no RMID the limbo handler
> returns to the free list can be used before the next mount, and that
> mount can check them itself. The MBM overflow handler already stops for
> this reason once resctrl_mounted is cleared.
>
> Reading the RMIDs in limbo while resctrl is unmounted is not safe on
> every architecture. On MPAM the counter of an RMID is selected by the
> CLOSID that owns it, and the CLOSID depends on the CDP state. Unmount
> clears the CDP state, so the limbo handler that keeps running reads the
> RMIDs freed under CDP through the CLOSIDs of the cleared state.
>
> Stop the limbo handler while resctrl is unmounted, as the overflow
> handler does, and restart it after a mount on every domain that still
> has RMIDs in limbo. The worker can stay queued across the unmount, so
> cancel it before queuing it again.
>
> Fixes: 6789fb99282c ("arm_mpam: resctrl: Add CDP emulation")
> Suggested-by: Reinette Chatre <reinette.chatre@xxxxxxxxx>
> Signed-off-by: Jinjie Ruan <ruanjinjie@xxxxxxxxxx>
> Cc: <stable@xxxxxxxxxxxxxxx>
> ---
Thank you.
With line break issue pointed out by Ben fixed:
| Reviewed-by: Reinette Chatre <reinette.chatre@xxxxxxxxx>
Reinette