mm, hugetlb: return a reserved page to a reserved pool if failed
authorJoonsoo Kim <iamjoonsoo.kim@lge.com>
Wed, 11 Sep 2013 21:21:58 +0000 (14:21 -0700)
committerMark Brown <broonie@linaro.org>
Thu, 12 Jun 2014 15:11:25 +0000 (16:11 +0100)
commit2923c9889893775f6efb4a396b89f7cb85972270
tree8e598e94a8905a4cd4be95a579ea6a17156265dd
parent6f9971e037a3a7d6fc7c97c20d520d3dc01569f9
mm, hugetlb: return a reserved page to a reserved pool if failed

If we fail with a reserved page, just calling put_page() is not
sufficient, because put_page() invoke free_huge_page() at last step and it
doesn't know whether a page comes from a reserved pool or not.  So it
doesn't do anything related to reserved count.  This makes reserve count
lower than how we need, because reserve count already decrease in
dequeue_huge_page_vma().  This patch fix this situation.

Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Aneesh Kumar <aneesh.kumar@linux.vnet.ibm.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Davidlohr Bueso <davidlohr@hp.com>
Cc: David Gibson <david@gibson.dropbear.id.au>
Cc: Wanpeng Li <liwanp@linux.vnet.ibm.com>
Cc: Hillf Danton <dhillf@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 07443a85ad90c7b62fbe11dcd3d6a1de1e10516f)
Signed-off-by: Mark Brown <broonie@linaro.org>
mm/hugetlb.c