]> git.baikalelectronics.ru Git - kernel.git/commit
Do not account for hugetlbfs quota at mmap() time if mapping [SHM|MAP]_NORESERVE
authorMel Gorman <mel@csn.ul.ie>
Wed, 11 Feb 2009 16:34:16 +0000 (16:34 +0000)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 11 Feb 2009 20:38:09 +0000 (12:38 -0800)
commit4c43a1b028d053796f3655a644ac3c86a3089210
treea1a9a07e2eb70e8c474d3bd040d724413bde9718
parent447249572257e6c3f4981a227cfd727e5d650292
Do not account for hugetlbfs quota at mmap() time if mapping [SHM|MAP]_NORESERVE

Commit 7accb921aa9f9e02510e5e3e78fd4aa85a398987 brought hugetlbfs more
in line with the core VM by obeying VM_NORESERVE and not reserving
hugepages for both shared and private mappings when [SHM|MAP]_NORESERVE
are specified.  However, it is still taking filesystem quota
unconditionally.

At fault time, if there are no reserves and attempt is made to allocate
the page and account for filesystem quota.  If either fail, the fault
fails.  The impact is that quota is getting accounted for twice.  This
patch partially reverts 7accb921aa9f9e02510e5e3e78fd4aa85a398987.  To
help prevent this mistake happening again, it improves the documentation
of hugetlb_reserve_pages()

Reported-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Acked-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/hugetlb.c