hugetlb: make unmap_ref_private multi-size-aware
authorAdam Litke <agl@us.ibm.com>
Wed, 12 Nov 2008 21:24:56 +0000 (13:24 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 20 Nov 2008 22:54:46 +0000 (14:54 -0800)
commit6fc576fc6c06dc972f5bb0a78bb76e81e9860d2b
tree1ec67e75c4e9abe34e270e54f820a09d19295f5c
parent5f33ce31fb5cffd4daf1bd4aedd0936983524b0a
hugetlb: make unmap_ref_private multi-size-aware

commit 7526674de0c921e7f1e9b6f71a1f9d832557b554 upstream.

Oops.  Part of the hugetlb private reservation code was not fully
converted to use hstates.

When a huge page must be unmapped from VMAs due to a failed COW,
HPAGE_SIZE is used in the call to unmap_hugepage_range() regardless of
the page size being used.  This works if the VMA is using the default
huge page size.  Otherwise we might unmap too much, too little, or
trigger a BUG_ON.  Rare but serious -- fix it.

Signed-off-by: Adam Litke <agl@us.ibm.com>
Cc: Jon Tollefson <kniht@linux.vnet.ibm.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
mm/hugetlb.c