--- mm/migrate.c | 6 +++--- mm/page_alloc.c | 6 ++++-- mm/sparse.c | 21 +++------------------ mm/swapfile.c | 4 ++-- 4 files changed, 12 insertions(+), 25 deletions(-) Index: linux-2.6/mm/migrate.c =================================================================== --- linux-2.6.orig/mm/migrate.c 2007-09-15 21:42:51.000000000 -0700 +++ linux-2.6/mm/migrate.c 2007-09-15 21:55:03.000000000 -0700 @@ -26,7 +26,6 @@ #include #include #include -#include #include #include "internal.h" @@ -961,7 +960,8 @@ asmlinkage long sys_move_pages(pid_t pid goto out2; } - pm = vmalloc((nr_pages + 1) * sizeof(struct page_to_node)); + pm = get_free_pages(get_order((nr_pages + 1) * sizeof(struct page_to_node)), + GFP_KERNEL | __GFP_COMP | __GFP_VMALLOC); if (!pm) { err = -ENOMEM; goto out2; @@ -1012,7 +1012,7 @@ asmlinkage long sys_move_pages(pid_t pid err = -EFAULT; out: - vfree(pm); + free_page(pm); out2: mmput(mm); return err; Index: linux-2.6/mm/page_alloc.c =================================================================== --- linux-2.6.orig/mm/page_alloc.c 2007-09-15 21:39:43.000000000 -0700 +++ linux-2.6/mm/page_alloc.c 2007-09-15 21:42:35.000000000 -0700 @@ -2463,7 +2463,8 @@ int zone_wait_table_init(struct zone *zo * To use this new node's memory, further consideration will be * necessary. */ - zone->wait_table = (wait_queue_head_t *)vmalloc(alloc_size); + zone->wait_table = (wait_queue_head_t *)get_free_pages(get_order(size), + GFP_KERNEL | __GFP_COMP | __GFP_VMALLOC); } if (!zone->wait_table) return -ENOMEM; @@ -3899,7 +3900,8 @@ void *__init alloc_large_system_hash(con if (flags & HASH_EARLY) table = alloc_bootmem(size); else if (hashdist) - table = __vmalloc(size, GFP_ATOMIC, PAGE_KERNEL); + table = get_free_pages(get_order(size), + GFP_ATOMIC | __GFP_COMP | __GFP_VMALLOC); else { unsigned long order; for (order = 0; ((1UL << order) << PAGE_SHIFT) < size; order++) Index: linux-2.6/mm/sparse.c =================================================================== --- linux-2.6.orig/mm/sparse.c 2007-09-15 21:44:18.000000000 -0700 +++ linux-2.6/mm/sparse.c 2007-09-15 21:46:06.000000000 -0700 @@ -7,7 +7,6 @@ #include #include #include -#include #include /* @@ -272,14 +271,11 @@ static struct page *__kmalloc_section_me struct page *page, *ret; unsigned long memmap_size = sizeof(struct page) * nr_pages; - page = alloc_pages(GFP_KERNEL|__GFP_NOWARN, get_order(memmap_size)); + page = alloc_pages(GFP_KERNEL|__GFP_NOWARN|__GFP_VMALLOC, + get_order(memmap_size)); if (page) goto got_map_page; - ret = vmalloc(memmap_size); - if (ret) - goto got_map_ptr; - return NULL; got_map_page: ret = (struct page *)pfn_to_kaddr(page_to_pfn(page)); @@ -289,20 +285,9 @@ got_map_ptr: return ret; } -static int vaddr_in_vmalloc_area(void *addr) -{ - if (addr >= (void *)VMALLOC_START && - addr < (void *)VMALLOC_END) - return 1; - return 0; -} - static void __kfree_section_memmap(struct page *memmap, unsigned long nr_pages) { - if (vaddr_in_vmalloc_area(memmap)) - vfree(memmap); - else - free_pages((unsigned long)memmap, + free_pages((unsigned long)memmap, get_order(sizeof(struct page) * nr_pages)); } Index: linux-2.6/mm/swapfile.c =================================================================== --- linux-2.6.orig/mm/swapfile.c 2007-09-15 21:46:29.000000000 -0700 +++ linux-2.6/mm/swapfile.c 2007-09-15 21:47:22.000000000 -0700 @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -1597,7 +1596,8 @@ asmlinkage long sys_swapon(const char __ goto bad_swap; /* OK, set up the swap map and apply the bad block list */ - if (!(p->swap_map = vmalloc(maxpages * sizeof(short)))) { + if (!(p->swap_map = get_free_pages(get_order(maxpages * sizeof(short)), + GFP_KERNEL | __GFP_VMALLOC))) { error = -ENOMEM; goto bad_swap; }