[PATCH 3/4] memcg: fix page migration to reset_owner

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Usually, migration pages coming to unmap_and_move()'s putback_lru_page()
have been charged and have pc->mem_cgroup set; but there are several ways
in which a freshly allocated uncharged page can get there, oopsing when
added to LRU.  Call mem_cgroup_reset_owner() immediately after allocating.

Signed-off-by: Hugh Dickins <hughd@xxxxxxxxxx>
---
Fix N to
    memcg: clear pc->mem_cgorup if necessary.

 mm/migrate.c |    2 ++
 1 file changed, 2 insertions(+)

--- mmotm.orig/mm/migrate.c	2011-12-22 02:53:31.900041565 -0800
+++ mmotm/mm/migrate.c	2011-12-28 14:52:37.243034125 -0800
@@ -841,6 +841,8 @@ static int unmap_and_move(new_page_t get
 	if (!newpage)
 		return -ENOMEM;
 
+	mem_cgroup_reset_owner(newpage);
+
 	if (page_count(page) == 1) {
 		/* page was freed from under us. So we are done. */
 		goto out;

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]