[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190324222040.GE31194@localhost.localdomain>
Date: Sun, 24 Mar 2019 16:20:41 -0600
From: Keith Busch <kbusch@...nel.org>
To: Yang Shi <yang.shi@...ux.alibaba.com>
Cc: mhocko@...e.com, mgorman@...hsingularity.net, riel@...riel.com,
hannes@...xchg.org, akpm@...ux-foundation.org,
dave.hansen@...el.com, keith.busch@...el.com,
dan.j.williams@...el.com, fengguang.wu@...el.com, fan.du@...el.com,
ying.huang@...el.com, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 06/10] mm: vmscan: demote anon DRAM pages to PMEM node
On Sat, Mar 23, 2019 at 12:44:31PM +0800, Yang Shi wrote:
> /*
> + * Demote DRAM pages regardless the mempolicy.
> + * Demot anonymous pages only for now and skip MADV_FREE
> + * pages.
> + */
> + if (PageAnon(page) && !PageSwapCache(page) &&
> + (node_isset(page_to_nid(page), def_alloc_nodemask)) &&
> + PageSwapBacked(page)) {
> +
> + if (has_nonram_online()) {
> + list_add(&page->lru, &demote_pages);
> + unlock_page(page);
> + continue;
> + }
> + }
> +
> + /*
> * Anonymous process memory has backing store?
> * Try to allocate it some swap space here.
> * Lazyfree page could be freed directly
> @@ -1477,6 +1507,25 @@ static unsigned long shrink_page_list(struct list_head *page_list,
> VM_BUG_ON_PAGE(PageLRU(page) || PageUnevictable(page), page);
> }
>
> + /* Demote pages to PMEM */
> + if (!list_empty(&demote_pages)) {
> + int err, target_nid;
> + nodemask_t used_mask;
> +
> + nodes_clear(used_mask);
> + target_nid = find_next_best_node(pgdat->node_id, &used_mask,
> + true);
> +
> + err = migrate_pages(&demote_pages, alloc_new_node_page, NULL,
> + target_nid, MIGRATE_ASYNC, MR_DEMOTE);
> +
> + if (err) {
> + putback_movable_pages(&demote_pages);
> +
> + list_splice(&ret_pages, &demote_pages);
> + }
> + }
> +
> mem_cgroup_uncharge_list(&free_pages);
> try_to_unmap_flush();
> free_unref_page_list(&free_pages);
How do these pages eventually get to swap when migration fails? Looks
like that's skipped.
And page cache demotion is useful too, we shouldn't consider only
anonymous for this feature.
Powered by blists - more mailing lists