lkml.org 
[lkml]   [2019]   [Feb]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[RFC PATCH 03/31] mm: migrate: Add tmpfs exchange support.
Date
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
\
 
 \ /
  Last update: 2019-02-15 23:04    [W:0.041 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site