linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mm: migrate: consolidate mem_cgroup_migrate() calls
@ 2016-02-04 20:07 Johannes Weiner
  2016-02-04 20:07 ` [PATCH 2/2] mm: memcontrol: drop unnecessary lru locking from mem_cgroup_migrate() Johannes Weiner
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Johannes Weiner @ 2016-02-04 20:07 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Hugh Dickins, Vladimir Davydov, Michal Hocko, Mateusz Guzik,
	Sergey Senozhatsky, linux-mm, cgroups, linux-kernel, kernel-team

Rather than scattering mem_cgroup_migrate() calls all over the place,
have a single call from a safe place where every migration operation
eventually ends up in - migrate_page_copy().

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Suggested-by: Hugh Dickins <hughd@google.com>
---
 mm/migrate.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/mm/migrate.c b/mm/migrate.c
index 17db63b2dd36..90cbf7c65cac 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -331,8 +331,6 @@ int migrate_page_move_mapping(struct address_space *mapping,
 		if (PageSwapBacked(page))
 			SetPageSwapBacked(newpage);
 
-		mem_cgroup_migrate(page, newpage);
-
 		return MIGRATEPAGE_SUCCESS;
 	}
 
@@ -428,8 +426,6 @@ int migrate_page_move_mapping(struct address_space *mapping,
 	}
 	local_irq_enable();
 
-	mem_cgroup_migrate(page, newpage);
-
 	return MIGRATEPAGE_SUCCESS;
 }
 
@@ -471,8 +467,6 @@ int migrate_huge_page_move_mapping(struct address_space *mapping,
 
 	spin_unlock_irq(&mapping->tree_lock);
 
-	mem_cgroup_migrate(page, newpage);
-
 	return MIGRATEPAGE_SUCCESS;
 }
 
@@ -586,6 +580,8 @@ void migrate_page_copy(struct page *newpage, struct page *page)
 		end_page_writeback(newpage);
 
 	copy_page_owner(page, newpage);
+
+	mem_cgroup_migrate(page, newpage);
 }
 
 /************************************************************
@@ -1846,7 +1842,6 @@ fail_putback:
 	}
 
 	mlock_migrate_page(new_page, page);
-	mem_cgroup_migrate(page, new_page);
 	page_remove_rmap(page, true);
 	set_page_owner_migrate_reason(new_page, MR_NUMA_MISPLACED);
 
-- 
2.7.0

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-03-04 18:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-04 20:07 [PATCH 1/2] mm: migrate: consolidate mem_cgroup_migrate() calls Johannes Weiner
2016-02-04 20:07 ` [PATCH 2/2] mm: memcontrol: drop unnecessary lru locking from mem_cgroup_migrate() Johannes Weiner
2016-02-07 18:41   ` Vladimir Davydov
2016-02-07 18:57     ` Johannes Weiner
2016-03-04 18:04   ` Michal Hocko
2016-02-07 18:33 ` [PATCH 1/2] mm: migrate: consolidate mem_cgroup_migrate() calls Vladimir Davydov
2016-03-04 18:02 ` Michal Hocko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).