]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mm/hugetlb_cgroup: Add huge_page_order check to avoid incorrectly uncharge
authorWanpeng Li <liwp@linux.vnet.ibm.com>
Sat, 21 Jul 2012 00:54:02 +0000 (10:54 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 25 Jul 2012 03:02:25 +0000 (13:02 +1000)
commit7b11fc5cba0d9d928aebfe9fc9900d0332d11cab
tree13eb8d0aaa57b0c4594772fb9ea2d4d3e3d2de99
parent08a4a9efa2650c220499ba80b334f57ed4006e18
mm/hugetlb_cgroup: Add huge_page_order check to avoid incorrectly uncharge

alloc_huge_page() will call hugetlb_cgroup_charge_cgroup() to charge
pages, the compound page have less than 3 pages will not charge to hugetlb
cgroup.  When alloc_huge_page fails it will call
hugetlb_cgroup_uncharge_cgroup to uncharge pages, however,
hugetlb_cgroup_uncharge_cgroup doesn't have huge_page_order check.  That
means it will uncharge pages even if the compound page have less than 3
pages.  Add huge_page_order check to avoid this incorrectly uncharge.

Reviewed-by: Michal Hocko <mhocko@suse.cz>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Wanpeng Li <liwp.linux@gmail.com>
Cc: David Rientjes <rientjes@google.com>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Hillf Danton <dhillf@gmail.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/hugetlb_cgroup.c