Adam Litke 2fc39cec6a hugetlb: debit quota in alloc_huge_page
Now that quota is credited by free_huge_page(), calls to hugetlb_get_quota()
seem out of place.  The alloc/free API is unbalanced because we handle the
hugetlb_put_quota() but expect the caller to open-code hugetlb_get_quota().
Move the get inside alloc_huge_page to clean up this disparity.

This patch has been kept apart from the previous patch because of the somewhat
dodgy ERR_PTR() use herein.  Moving the quota logic means that
alloc_huge_page() has two failure modes.  Quota failure must result in a
SIGBUS while a standard allocation failure is OOM.  Unfortunately, ERR_PTR()
doesn't like the small positive errnos we have in VM_FAULT_* so they must be
negated before they are used.

Does anyone take issue with the way I am using PTR_ERR.  If so, what are your
thoughts on how to clean this up (without needing an if,else if,else block at
each alloc_huge_page() callsite)?

Signed-off-by: Adam Litke <agl@us.ibm.com>
Cc: Ken Chen <kenchen@google.com>
Cc: Andy Whitcroft <apw@shadowen.org>
Cc: Dave Hansen <haveblue@us.ibm.com>
Cc: David Gibson <hermes@gibson.dropbear.id.au>
Cc: William Lee Irwin III <wli@holomorphy.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14 18:45:40 -08:00
..
2007-10-17 08:42:45 -07:00
2007-10-16 09:42:54 -07:00
2007-07-17 10:22:59 -07:00
2007-10-20 02:46:58 +02:00
2007-10-16 09:43:02 -07:00
2007-10-20 01:27:18 +02:00
2007-10-20 02:13:26 +02:00
2007-02-15 09:57:03 -08:00
2007-10-23 08:32:06 -07:00
2007-10-18 14:37:31 -07:00
2007-05-21 09:18:19 -07:00
2007-10-29 07:53:26 -07:00
2007-10-20 15:04:06 -07:00
2007-10-20 01:27:18 +02:00
2007-05-07 12:12:54 -07:00
2007-10-17 08:42:45 -07:00
2007-11-12 10:32:29 -08:00
2007-10-20 01:27:18 +02:00
2007-10-17 08:42:55 -07:00
2007-10-20 01:27:18 +02:00
2007-10-20 01:27:18 +02:00