]> git.baikalelectronics.ru Git - kernel.git/commit
mm: memcontrol: update mem_cgroup_page_lruvec() documentation
authorJohannes Weiner <hannes@cmpxchg.org>
Wed, 10 Dec 2014 23:43:43 +0000 (15:43 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 11 Dec 2014 01:41:06 +0000 (17:41 -0800)
commit1d9419e9b8a916d924759587a298a4a13bc7b156
treec1c18fcb86fe5fa24207eda5ba611d64eddf9e4d
parent24cc25be604e98bcfd4b1b07592c3bd9e046d8fd
mm: memcontrol: update mem_cgroup_page_lruvec() documentation

Commit 87c264374f03 ("memcg: fix GPF when cgroup removal races with last
exit") added a pc->mem_cgroup reset into mem_cgroup_page_lruvec() to
prevent a crash where an anon page gets uncharged on unmap, the memcg is
released, and then the final LRU isolation on free dereferences the
stale pc->mem_cgroup pointer.

But since commit 81c31c36ef54 ("mm: memcontrol: rewrite uncharge API"),
pages are only uncharged AFTER that final LRU isolation, which
guarantees the memcg's lifetime until then.  pc->mem_cgroup now only
needs to be reset for swapcache readahead pages.

Update the comment and callsite requirements accordingly.

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