diff options
author | Jérôme Glisse <[email protected]> | 2017-10-03 16:14:57 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2017-10-03 17:54:24 -0700 |
commit | 3f2eb0287ebd62ec8d6d544f830285302279e6bf (patch) | |
tree | 5766ffd772c97ed7e06decf7aeb3514bbc034071 | |
parent | 72f0184c8a00c70179cfed6266e2e06b4d400065 (diff) |
mm/memcg: avoid page count check for zone device
Fix for 4.14, zone device page always have an elevated refcount of one
and thus page count sanity check in uncharge_page() is inappropriate for
them.
[[email protected]: nano-optimize VM_BUG_ON in uncharge_page]
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Jérôme Glisse <[email protected]>
Signed-off-by: Michal Hocko <[email protected]>
Reported-by: Evgeny Baskakov <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Vladimir Davydov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r-- | mm/memcontrol.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 696c6529e900..d5f3a62887cf 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -5658,7 +5658,8 @@ static void uncharge_batch(const struct uncharge_gather *ug) static void uncharge_page(struct page *page, struct uncharge_gather *ug) { VM_BUG_ON_PAGE(PageLRU(page), page); - VM_BUG_ON_PAGE(!PageHWPoison(page) && page_count(page), page); + VM_BUG_ON_PAGE(page_count(page) && !is_zone_device_page(page) && + !PageHWPoison(page) , page); if (!page->mem_cgroup) return; |