Re: [PATCH -next 4/5] mm/mglru: combine shrink_many into shrink_node_memcgs

From: Chen Ridong

Date: Mon Dec 22 2025 - 02:40:49 EST




On 2025/12/16 5:17, Johannes Weiner wrote:
> On Tue, Dec 09, 2025 at 01:25:56AM +0000, Chen Ridong wrote:
>> @@ -5822,6 +5779,12 @@ static void shrink_node_memcgs(pg_data_t *pgdat, struct scan_control *sc)
>>
>> shrink_one(lruvec, sc);
>>
>> + if (should_abort_scan(lruvec, sc)) {
>
> Can you please rename this and add the jump label check?
>
> if (lru_gen_enabled() && lru_gen_should_abort_scan())
>
> The majority of the checks in there already happen inside
> shrink_node_memcgs() itself. Factoring those out is probably better in
> another patch, but no need to burden classic LRU in the meantime.

Adding should_abort_scan for the classic LRU seems reasonable, as it would allow the scan to stop
earlier when sufficient pages have been reclaimed or watermark is satisfied for global recalim.

Refer to the discussion here:

https://lore.kernel.org/lkml/20251209012557.1949239-1-chenridong@xxxxxxxxxxxxxxx/T/#m4eea017f5a222ba676d9222f59ad8c898ac2aefe

--
Best regards,
Ridong