fix leaky resv_huge_pages when cpuset is in use
[powerpc.git] / mm / hugetlb.c
index 36db012..88e708b 100644 (file)
@@ -140,6 +140,8 @@ static struct page *alloc_huge_page(struct vm_area_struct *vma,
        return page;
 
 fail:
+       if (vma->vm_flags & VM_MAYSHARE)
+               resv_huge_pages++;
        spin_unlock(&hugetlb_lock);
        return NULL;
 }