[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YkMOrjhxkqMx45Es@casper.infradead.org>
Date: Tue, 29 Mar 2022 14:50:38 +0100
From: Matthew Wilcox <willy@...radead.org>
To: Miaohe Lin <linmiaohe@...wei.com>
Cc: akpm@...ux-foundation.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/8] mm/vmscan: introduce helper function
reclaim_page_list()
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?
Powered by blists - more mailing lists