]> pilppa.com Git - linux-2.6-omap-h63xx.git/commit
hugetlb: enforce quotas during reservation for shared mappings
authorAdam Litke <agl@us.ibm.com>
Thu, 15 Nov 2007 00:59:42 +0000 (16:59 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 15 Nov 2007 02:45:40 +0000 (18:45 -0800)
commit90d8b7e6129e8f4e5b3bc1a2cfbe585372ce8646
tree7a078249e1a468dc3ec5973c14f8f6a95cb0620f
parent9a119c056dc2a9970901954a6d561d50a95e528d
hugetlb: enforce quotas during reservation for shared mappings

When a MAP_SHARED mmap of a hugetlbfs file succeeds, huge pages are reserved
to guarantee no problems will occur later when instantiating pages.  If quotas
are in force, page instantiation could fail due to a race with another process
or an oversized (but approved) shared mapping.

To prevent these scenarios, debit the quota for the full reservation amount up
front and credit the unused quota when the reservation is released.

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>
mm/hugetlb.c