Re: [PATCH v4 3/5] mm/vmscan: extract pageout_one() from shrink_folio_list()
From: David Hildenbrand (Arm)
Date: Wed Jun 17 2026 - 08:29:27 EST
On 6/17/26 14:19, David Hildenbrand (Arm) wrote:
> On 5/25/26 16:57, Zhang Peng wrote:
>> shrink_folio_list() contains a self-contained pageout() dispatch state
>> machine. Extract it into pageout_one() to reduce the size of
>> shrink_folio_list() and make the pageout step independently readable.
>>
>> No functional change.
>>
>> Signed-off-by: Zhang Peng <bruzzhang@xxxxxxxxxxx>
>> ---
>> mm/vmscan.c | 107 ++++++++++++++++++++++++++++++++++++------------------------
>> 1 file changed, 65 insertions(+), 42 deletions(-)
>>
>> diff --git a/mm/vmscan.c b/mm/vmscan.c
>> index b31f67801836..456d38eb172c 100644
>> --- a/mm/vmscan.c
>> +++ b/mm/vmscan.c
>> @@ -1161,8 +1161,68 @@ static bool folio_free(struct folio *folio, struct folio_batch *free_folios,
>> return true;
>> }
>>
>> +static bool pageout_one(struct folio *folio,
>> + struct folio_batch *free_folios,
>> + struct scan_control *sc, struct reclaim_stat *stat,
>> + struct swap_iocb **plug, struct list_head *folio_list,
>> + unsigned int *nr_reclaimed)
>
> Two tabs please.
>
> Same comment regarding returning a bool.
Thinking again, should we call this "folio_try_pageout" or something like that
(and keep the bool)?
--
Cheers,
David