[PATCH][RFC] mm: memcontrol: fix a unbalance uncharged count

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

 



From: Li RongQing <roy.qing.li@xxxxxxxxx>

I see the number of page of hpage_nr_pages(page) is charged if page is
transparent huge or hugetlbfs pages; but when uncharge a huge page,
(1<<compound_order) page is uncharged, and maybe hpage_nr_pages(page) is
not same as 1<<compound_order.

And remove VM_BUG_ON_PAGE(!PageTransHuge(page), page); since
PageTransHuge(page) always is true, when this VM_BUG_ON_PAGE is called.

Signed-off-by: Li RongQing <roy.qing.li@xxxxxxxxx>
---
 mm/memcontrol.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 12aaadd..28c0137 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -5453,8 +5453,7 @@ static void uncharge_list(struct list_head *page_list)
 		}
 
 		if (PageTransHuge(page)) {
-			nr_pages <<= compound_order(page);
-			VM_BUG_ON_PAGE(!PageTransHuge(page), page);
+			nr_pages = hpage_nr_pages(page);
 			nr_huge += nr_pages;
 		}
 
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe cgroups" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



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

  Powered by Linux