Re: [PATCH v4 RESEND 0/5] mm: restore per-memcg reclaim for NONSLAB shrinkers under nokmem
From: Qinyun Tan
Date: Mon Nov 23 2026 - 00:34:24 EST
Hi Andrew,
On 11/21/26 11:11 AM, Andrew Morton wrote:
> On Fri, 20 Nov 2026 15:04:37 +0800 Qinyun Tan <qinyuntan@xxxxxxxxxxxxxxxxx> wrote:
>
> Yes, it sounds like ->css.id better matches the lifetime needs. And
> the root memcg list_lru retains index=0?
>
Yes. With this series, index 0 still selects the root memcg's per-node
list directly. Only non-root memcgs use memcg->css.id as the XArray
index.
>> The second finding is the same race that Shakeel's patch [1] addresses.
>> It predates this series: a folio can move to the root memcg between
>> the two lookups in folio_memcg_list_lru_alloc(). Shakeel's patch
>> rechecks whether allocation is needed after taking the memcg reference.
>> That also prevents the unnecessary allocation at index 0 that Sashiko
>> flagged in v4.
>>
>> Does using the CSS ID for the list_lru index sound reasonable? I'd be
>> happy to incorporate any suggestions and send a v5.
>
> Shakeel has a couple of related fixes in mm-usable ("mm: list_lru: fix
> NULL deref when a folio moves to the root memcg" and "mm: list_lru:
> don't use a new memcg's lists for an offline memcg") so please base on
> that.
Thanks, I'll rebase the series on top of Shakeel's two fixes and send v5.
Best regards,
Qinyun Tan