Re: [PATCH v3 2/3] mm: shmem: move unused huge shrinklist queuing past the truncation check
From: Baolin Wang
Date: Tue Aug 04 2026 - 23:20:53 EST
On 8/3/26 4:46 PM, Qi Zheng wrote:
From: Qi Zheng <zhengqi.arch@xxxxxxxxxxxxx>
The shmem_get_folio_gfp() adds the inode to the unused huge shrinker list
at the alloced label, but a subsequent truncation check may still fail and
remove the folio, leaving the inode on the list with a stale folio.
The original code works because the shrinker re-looks-up the folio and
drops stale entries, but it is cleaner to queue the inode only after all
checks that might remove the folio have passed.
So just make the pure structural move with no functional change, and it
serves as preparation for the memcg-aware shrinker conversion.
Signed-off-by: Qi Zheng <zhengqi.arch@xxxxxxxxxxxxx>
---
LGTM. Thanks.
Reviewed-by: Baolin Wang <baolin.wang@xxxxxxxxxxxxxxxxx>