X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=mm%2Fbootmem.c;h=260e703850d827d81356f64222a8beceb9f19b0c;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=092d8517649091811a287a9ad0dbff01465a8f78;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/mm/bootmem.c b/mm/bootmem.c index 092d85176..260e70385 100644 --- a/mm/bootmem.c +++ b/mm/bootmem.c @@ -19,6 +19,7 @@ #include #include #include +#include "internal.h" /* * Access to this subsystem has to be serialized externally. (this is @@ -275,17 +276,18 @@ static unsigned long __init free_all_bootmem_core(pg_data_t *pgdat) for (i = 0; i < idx; ) { unsigned long v = ~map[i / BITS_PER_LONG]; if (gofast && v == ~0UL) { - int j; + int j, order; count += BITS_PER_LONG; __ClearPageReserved(page); - set_page_count(page, 1); + order = ffs(BITS_PER_LONG) - 1; + set_page_refs(page, order); for (j = 1; j < BITS_PER_LONG; j++) { if (j + 16 < BITS_PER_LONG) prefetchw(page + j + 16); __ClearPageReserved(page + j); } - __free_pages(page, ffs(BITS_PER_LONG)-1); + __free_pages(page, order); i += BITS_PER_LONG; page += BITS_PER_LONG; } else if (v) { @@ -294,7 +296,7 @@ static unsigned long __init free_all_bootmem_core(pg_data_t *pgdat) if (v & m) { count++; __ClearPageReserved(page); - set_page_count(page, 1); + set_page_refs(page, 0); __free_page(page); } } @@ -343,31 +345,29 @@ unsigned long __init free_all_bootmem_node (pg_data_t *pgdat) return(free_all_bootmem_core(pgdat)); } -#ifndef CONFIG_DISCONTIGMEM unsigned long __init init_bootmem (unsigned long start, unsigned long pages) { max_low_pfn = pages; min_low_pfn = start; - return(init_bootmem_core(&contig_page_data, start, 0, pages)); + return(init_bootmem_core(NODE_DATA(0), start, 0, pages)); } #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE void __init reserve_bootmem (unsigned long addr, unsigned long size) { - reserve_bootmem_core(contig_page_data.bdata, addr, size); + reserve_bootmem_core(NODE_DATA(0)->bdata, addr, size); } #endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */ void __init free_bootmem (unsigned long addr, unsigned long size) { - free_bootmem_core(contig_page_data.bdata, addr, size); + free_bootmem_core(NODE_DATA(0)->bdata, addr, size); } unsigned long __init free_all_bootmem (void) { - return(free_all_bootmem_core(&contig_page_data)); + return(free_all_bootmem_core(NODE_DATA(0))); } -#endif /* !CONFIG_DISCONTIGMEM */ void * __init __alloc_bootmem (unsigned long size, unsigned long align, unsigned long goal) {