[PATCH] hugetlb: overcommit accounting check
authorAdam Litke <agl@us.ibm.com>
Sun, 30 Oct 2005 01:16:47 +0000 (18:16 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sun, 30 Oct 2005 04:40:43 +0000 (21:40 -0700)
commit2e9b367c2273ed21c9852a04d90944d472c4f3e6
tree75e802f07a8c4f0554547e8dd795f544c7e9d7e8
parent4c887265977213985091476be40ab11dfdcb4caf
[PATCH] hugetlb: overcommit accounting check

Basic overcommit checking for hugetlb_file_map() based on an implementation
used with demand faulting in SLES9.

Since demand faulting can't guarantee the availability of pages at mmap
time, this patch implements a basic sanity check to ensure that the number
of huge pages required to satisfy the mmap are currently available.
Despite the obvious race, I think it is a good start on doing proper
accounting.  I'd like to work towards an accounting system that mimics the
semantics of normal pages (especially for the MAP_PRIVATE/COW case).  That
work is underway and builds on what this patch starts.

Huge page shared memory segments are simpler and still maintain their
commit on shmget semantics.

Signed-off-by: Adam Litke <agl@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/hugetlbfs/inode.c