aboutsummaryrefslogtreecommitdiffstats
path: root/mm/migrate.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/migrate.c')
-rw-r--r--mm/migrate.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/mm/migrate.c b/mm/migrate.c
index 11c6c56ec017..6602941bfab0 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -330,8 +330,6 @@ static int migrate_page_move_mapping(struct address_space *mapping,
330 __inc_zone_page_state(newpage, NR_FILE_PAGES); 330 __inc_zone_page_state(newpage, NR_FILE_PAGES);
331 331
332 spin_unlock_irq(&mapping->tree_lock); 332 spin_unlock_irq(&mapping->tree_lock);
333 if (!PageSwapCache(newpage))
334 mem_cgroup_uncharge_cache_page(page);
335 333
336 return 0; 334 return 0;
337} 335}
@@ -341,6 +339,8 @@ static int migrate_page_move_mapping(struct address_space *mapping,
341 */ 339 */
342static void migrate_page_copy(struct page *newpage, struct page *page) 340static void migrate_page_copy(struct page *newpage, struct page *page)
343{ 341{
342 int anon;
343
344 copy_highpage(newpage, page); 344 copy_highpage(newpage, page);
345 345
346 if (PageError(page)) 346 if (PageError(page))
@@ -378,8 +378,13 @@ static void migrate_page_copy(struct page *newpage, struct page *page)
378#endif 378#endif
379 ClearPagePrivate(page); 379 ClearPagePrivate(page);
380 set_page_private(page, 0); 380 set_page_private(page, 0);
381 /* page->mapping contains a flag for PageAnon() */
382 anon = PageAnon(page);
381 page->mapping = NULL; 383 page->mapping = NULL;
382 384
385 if (!anon) /* This page was removed from radix-tree. */
386 mem_cgroup_uncharge_cache_page(page);
387
383 /* 388 /*
384 * If any waiters have accumulated on the new page then 389 * If any waiters have accumulated on the new page then
385 * wake them up. 390 * wake them up.