Re: [PATCH v10 RESEND 02/15] fs/resctrl: Skip monitor context allocation when force-freeing RMIDs

From: Reinette Chatre

Date: Wed Oct 28 2026 - 17:30:31 EST


Hi Jinjie,

On 10/26/26 6:33 PM, Jinjie Ruan wrote:
>
>
> 在 2026/10/26 22:11, Ben Horgan 写道:
>> Hi Jinjie,
>>
>> On 26/10/2026 14:08, Ben Horgan wrote:
>>> Hi Jinjie,
>>>
>>> On 20/10/2026 14:42, Jinjie Ruan wrote:
>>>> __check_limbo() allocates the architecture monitor context before the
>>>> scan loop, even when force_free is set. The force-free path never reads
>>>> occupancy and never uses the context.
>>>>
>>>> If the allocation fails, the function returns early and leaves the limbo
>>>> list unflushed. Callers such as the unmount path then silently fail to
>>>> return the RMIDs to the free list, leaving stale CLOSIDs in limbo that
>>>> are re-interpreted with the CDP state of the next mount.
>>>
>>> Is this a theoretical fix or is there some way that resctrl_arch_mon_ctx_alloc() can fail in practice?
>>
>> This does seem a good change to me and we do have to consider that the memory alocation might fail.
>
> Hi Ben,
>
> I agree. force_free=true not rely on the allocation of arch_mon_ctx
> succeeding, we should directly loop to free the RMID.
>
> Perhaps a small refactor is needed to split __check_limbo() into two
> versions as there isn't much duplication?
I agree that a split would look better here. With these additional checks of
force_free the __check_limbo() is becoming hard to follow. Even more than
two versions of __check_limbo() this could just be two distinct functions,
for example a new "void release_limbo_rmids(struct rdt_l3_mon_domain *d)"
that is only called from resctrl_offline_l3_mon_domain().

The changelog mentions the unmount path but it seems that the issue is with
domains going offline instead? As far as I understand the limbo state is not
impacted by mount/unmount.

I also think that the "Fixes:" tag should instead be:
fc16126cc11d ("x86,fs/resctrl: Prevent out-of-bounds access while offlining CPU when SNC enabled")

The first two fixes in this series look appropriate for resctrl fs. I'd like
to echo Ben's request to submit them separately from this work.

Thank you very much.

Reinette