Re: [PATCH v5 RESEND 2/7] fs/resctrl: Do not allocate a monitor context when releasing limbo RMIDs

From: Ben Horgan

Date: Thu Nov 12 2026 - 07:09:34 EST


Hi Jinjie,

On 10/11/2026 13:39, Jinjie Ruan wrote:
> Busy RMIDs of a monitor domain are normally released by the limbo
> handler once their cache occupancy drops below the threshold. When a
> domain goes offline, its busy RMIDs are released without checking
> occupancy, since the domain is going away and the RMIDs would otherwise
> never return to the free list.
>
> On the monitor domain offline path, __check_limbo() allocates the
> monitor context that an occupancy check needs before it scans the busy
> RMIDs, but without using it, and returns early when that allocation
> fails. Then the caller destroys the domain's monitoring state, including
> the bitmap that records which RMIDs are busy, so nothing can clear those
> bits afterwards and the busy counts never reach zero. Those RMIDs never
> return to the free list and, where the RMID depends on the CLOSID, the
> dirty count of their CLOSID never decreases. The allocation can also
> wait for a monitor to become free, which stalls the CPU offline path on
> a context that is not going to be used.
>
> Only MPAM systems are affected. An architecture that can always read an
> RMID allocates nothing for the monitor context, so the allocation can
> neither fail nor wait there.
>
> Move the release of busy RMIDs into a separate function that does not
> take a monitor context and leave the occupancy check to __check_limbo().
>
> Fixes: e557999f80a5 ("x86/resctrl: Allow arch to allocate memory needed in resctrl_arch_rmid_read()")
> Signed-off-by: Jinjie Ruan <ruanjinjie@xxxxxxxxxx>
> Reviewed-by: Reinette Chatre <reinette.chatre@xxxxxxxxx>
> Cc: James Morse <james.morse@xxxxxxx>
> Cc: Reinette Chatre <reinette.chatre@xxxxxxxxx>
> Cc: <stable@xxxxxxxxxxxxxxx> # 7.1.x


Looks good to me.

Reviewed-by: Ben Horgan <ben.horgan@xxxxxxx>