Messages in this thread Patch in this message | | | From | Zi Yan <> | Subject | [RFC PATCH 03/31] mm: migrate: Add tmpfs exchange support. | Date | Fri, 15 Feb 2019 14:03:06 -0800 |
| |
tmpfs uses the same migrate routine as anonymous pages, enabling exchange pages for it is easy.
Signed-off-by: Zi Yan <ziy@nvidia.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
| |