mm: memcontrol: clarify migration where old page is uncharged
authorJohannes Weiner <hannes@cmpxchg.org>
Wed, 10 Dec 2014 23:43:46 +0000 (15:43 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 11 Dec 2014 01:41:06 +0000 (17:41 -0800)
Better explain re-entrant migration when compaction races with reclaim,
and also mention swapcache readahead pages as possible uncharged migration
sources.

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Hugh Dickins <hughd@google.com>
Acked-by: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/memcontrol.c

index b495f29d4746a47deb5b5575c93a6d3e1b041710..a0ae64ca55bf6d21b8d469b18d296e8720ab57b3 100644 (file)
@@ -6157,7 +6157,12 @@ void mem_cgroup_migrate(struct page *oldpage, struct page *newpage,
        if (PageCgroupUsed(pc))
                return;
 
-       /* Re-entrant migration: old page already uncharged? */
+       /*
+        * Swapcache readahead pages can get migrated before being
+        * charged, and migration from compaction can happen to an
+        * uncharged page when the PFN walker finds a page that
+        * reclaim just put back on the LRU but has not released yet.
+        */
        pc = lookup_page_cgroup(oldpage);
        if (!PageCgroupUsed(pc))
                return;