/*
* kmalloc doesn't like __GFP_HIGHMEM for some reason
*/
- return kmalloc(size, (gfp_mask | __GFP_COMP) & ~__GFP_HIGHMEM);
+ return kmalloc(size, gfp_mask & ~__GFP_HIGHMEM);
}
struct page * vmalloc_to_page(void *addr)
* - note that this may not return a page-aligned address if the object
* we're allocating is smaller than a page
*/
- base = kmalloc(len, GFP_KERNEL|__GFP_COMP);
+ base = kmalloc(len, GFP_KERNEL);
if (!base)
goto enomem;
* only call if we're about to fail.
*/
n = nr_free_pages();
-
- /*
- * Leave reserved pages. The pages are not for anonymous pages.
- */
- if (n <= totalreserve_pages)
- goto error;
- else
- n -= totalreserve_pages;
-
- /*
- * Leave the last 3% for root
- */
if (!cap_sys_admin)
n -= n / 32;
free += n;
if (free > pages)
return 0;
-
- goto error;
+ vm_unacct_memory(pages);
+ return -ENOMEM;
}
allowed = totalram_pages * sysctl_overcommit_ratio / 100;
*/
if (atomic_read(&vm_committed_space) < (long)allowed)
return 0;
-error:
+
vm_unacct_memory(pages);
return -ENOMEM;