[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190215220334.29298-4-ziy@nvidia.com>
Date: Fri, 15 Feb 2019 14:03:06 -0800
From: Zi Yan <ziy@...dia.com>
To: <linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>
CC: Dave Hansen <dave.hansen@...ux.intel.com>,
Michal Hocko <mhocko@...nel.org>,
"Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Vlastimil Babka <vbabka@...e.cz>,
Mel Gorman <mgorman@...hsingularity.net>,
John Hubbard <jhubbard@...dia.com>,
Mark Hairgrove <mhairgrove@...dia.com>,
Nitin Gupta <nigupta@...dia.com>,
David Nellans <dnellans@...dia.com>, Zi Yan <ziy@...dia.com>
Subject: [RFC PATCH 03/31] mm: migrate: Add tmpfs exchange support.
tmpfs uses the same migrate routine as anonymous pages, enabling
exchange pages for it is easy.
Signed-off-by: Zi Yan <ziy@...dia.com>
---
mm/exchange.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/mm/exchange.c b/mm/exchange.c
index 8cf286fc0f10..851f1a99b48b 100644
--- a/mm/exchange.c
+++ b/mm/exchange.c
@@ -466,7 +466,10 @@ static int exchange_from_to_pages(struct page *to_page, struct page *from_page,
rc = exchange_page_move_mapping(to_page_mapping, from_page_mapping,
to_page, from_page, NULL, NULL, mode, 0, 0);
} else {
- if (to_page_mapping->a_ops->migratepage == buffer_migrate_page) {
+ /* shmem */
+ if (to_page_mapping->a_ops->migratepage == migrate_page)
+ goto exchange_mappings;
+ else if (to_page_mapping->a_ops->migratepage == buffer_migrate_page) {
if (!page_has_buffers(to_page))
goto exchange_mappings;
--
2.20.1
Powered by blists - more mailing lists