From e4e574b767ba63101cfda2b42d72f38546319297 Mon Sep 17 00:00:00 2001 From: Adam Litke Date: Tue, 16 Oct 2007 01:26:19 -0700 Subject: [PATCH] hugetlb: Try to grow hugetlb pool for MAP_SHARED mappings Shared mappings require special handling because the huge pages needed to fully populate the VMA must be reserved at mmap time. If not enough pages are available when making the reservation, allocate all of the shortfall at once from the buddy allocator and add the pages directly to the hugetlb pool. If they cannot be allocated, then fail the mapping. The page surplus is accounted for in the same way as for private mappings; faulted surplus pages will be freed at unmap time. Reserved, surplus pages that have not been used must be freed separately when their reservation has been released. Signed-off-by: Adam Litke Acked-by: Andy Whitcroft Acked-by: Dave McCracken Cc: William Irwin Cc: David Gibson Cc: Ken Chen Cc: Badari Pulavarty Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-format-patch failed