Re: [PATCH 3/8] mm/vmscan: introduce helper function reclaim_page_list()
From: Miaohe Lin
Date: Tue Mar 29 2022 - 22:05:02 EST
On 2022/3/29 21:50, Matthew Wilcox wrote:
> On Tue, Mar 29, 2022 at 09:26:14PM +0800, Miaohe Lin wrote:
>> -unsigned long reclaim_pages(struct list_head *page_list)
>> +static inline unsigned int reclaim_page_list(struct list_head *page_list, struct pglist_data *pgdat)
>> {
>> - int nid = NUMA_NO_NODE;
>> - unsigned int nr_reclaimed = 0;
>> - LIST_HEAD(node_page_list);
>> struct reclaim_stat dummy_stat;
>> + unsigned int nr_reclaimed;
>> struct page *page;
>> - unsigned int noreclaim_flag;
>> struct scan_control sc = {
>> .gfp_mask = GFP_KERNEL,
>> .may_writepage = 1,
>> @@ -2529,6 +2526,24 @@ unsigned long reclaim_pages(struct list_head *page_list)
>> .no_demotion = 1,
>> };
>>
>> + nr_reclaimed = shrink_page_list(page_list, pgdat, &sc, &dummy_stat, false);
>> + while (!list_empty(page_list)) {
>> + page = lru_to_page(page_list);
>> + list_del(&page->lru);
>> + putback_lru_page(page);
>
> Why wouldn't you use a folio here?
>
I was just wanting to keep the code consistent with the previous one. Am I supposed to
use a folio here ? If so, will do it in V2.
Thanks.
>
> .
>