aboutsummaryrefslogtreecommitdiff
path: root/kernel/gcov/base.c
diff options
context:
space:
mode:
authorMichal Hocko <[email protected]>2017-05-12 15:46:26 -0700
committerLinus Torvalds <[email protected]>2017-05-12 15:57:15 -0700
commit18365225f0440d09708ad9daade2ec11275c3df9 (patch)
tree9bf682111ea80465beb46c7bbc2f4ae7bc43f9e2 /kernel/gcov/base.c
parentdeac8429d62ca19c1571853e2a18f60e760ee04c (diff)
hwpoison, memcg: forcibly uncharge LRU pages
Laurent Dufour has noticed that hwpoinsoned pages are kept charged. In his particular case he has hit a bad_page("page still charged to cgroup") when onlining a hwpoison page. While this looks like something that shouldn't happen in the first place because onlining hwpages and returning them to the page allocator makes only little sense it shows a real problem. hwpoison pages do not get freed usually so we do not uncharge them (at least not since commit 0a31bc97c80c ("mm: memcontrol: rewrite uncharge API")). Each charge pins memcg (since e8ea14cc6ead ("mm: memcontrol: take a css reference for each charged page")) as well and so the mem_cgroup and the associated state will never go away. Fix this leak by forcibly uncharging a LRU hwpoisoned page in delete_from_lru_cache(). We also have to tweak uncharge_list because it cannot rely on zero ref count for these pages. [[email protected]: coding-style fixes] Fixes: 0a31bc97c80c ("mm: memcontrol: rewrite uncharge API") Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Michal Hocko <[email protected]> Reported-by: Laurent Dufour <[email protected]> Tested-by: Laurent Dufour <[email protected]> Reviewed-by: Balbir Singh <[email protected]> Reviewed-by: Naoya Horiguchi <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'kernel/gcov/base.c')
0 files changed, 0 insertions, 0 deletions