Sparsemem currently attempts to do a physically contiguous mapping and then falls back to vmalloc. The same thing can now be accomplished using virtual compound pages. Cc: apw@shadowen.org Signed-off-by: Christoph Lameter <clameter@sgi.com> --- mm/sparse.c | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) Index: linux-2.6.25-rc5-mm1/mm/sparse.c =================================================================== --- linux-2.6.25-rc5-mm1.orig/mm/sparse.c 2008-03-20 18:04:45.345133447 -0700 +++ linux-2.6.25-rc5-mm1/mm/sparse.c 2008-03-20 19:32:53.361317058 -0700 @@ -327,24 +327,7 @@ static void __kfree_section_memmap(struc #else static struct page *__kmalloc_section_memmap(unsigned long nr_pages) { - struct page *page, *ret; - unsigned long memmap_size = sizeof(struct page) * nr_pages; - - page = alloc_pages(GFP_KERNEL|__GFP_NOWARN, 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)); -got_map_ptr: - memset(ret, 0, memmap_size); - - return ret; + return __alloc_vcompound(GFP_KERNEL, get_order(memmap_size))); } static inline struct page *kmalloc_section_memmap(unsigned long pnum, int nid, @@ -355,11 +338,7 @@ static inline struct page *kmalloc_secti static void __kfree_section_memmap(struct page *memmap, unsigned long nr_pages) { - if (is_vmalloc_addr(memmap)) - vfree(memmap); - else - free_pages((unsigned long)memmap, - get_order(sizeof(struct page) * nr_pages)); + __free_vcompound(memmap); } #endif /* CONFIG_SPARSEMEM_VMEMMAP */ -- --
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Stoyan Gaydarov | From 2.4 to 2.6 to 2.7? |
| David Miller | Slow DOWN, please!!! |
| Bart Van Assche | Integration of SCST in the mainstream Linux kernel |
git: | |
| Joe Fiorini | Undo git-rm without commit? |
| Linus Torvalds | Re: VCS comparison table |
| Linus Torvalds | People unaware of the importance of "git gc"? |
| Luke Lu | git-svn questions: how to clone/init non-standard layout branches/tags? |
| Richard Stallman | Real men don't attack straw men |
| Juan Miscaro | When will OpenBSD support UTF8? |
| Daniel Ouellet | Bottleneck in httpd. I need help to address capacity issues on max parallel and ra... |
| Kevin Neff | Patching a SSH 'Weakness' |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Jiri Olsa | [PATCH] net: fix race in the receive/select |
| Arnaldo Carvalho de Melo | Re: [PATCH 03/37] dccp: List management for new feature negotiation |
| Eric Dumazet | Re: [PATCH] tcp: splice as many packets as possible at once |
