--- zzzz-none-000/linux-2.6.19.2/mm/page_alloc.c 2007-01-10 19:10:37.000000000 +0000 +++ davinci-8020-5504/linux-2.6.19.2/mm/page_alloc.c 2007-01-19 14:42:56.000000000 +0000 @@ -390,7 +390,7 @@ static inline void __free_one_page(struct page *page, struct zone *zone, unsigned int order) { - unsigned long page_idx; + unsigned long page_idx, index; int order_size = 1 << order; if (unlikely(PageCompound(page))) @@ -401,6 +401,11 @@ VM_BUG_ON(page_idx & (order_size - 1)); VM_BUG_ON(bad_range(zone, page)); +#ifdef CONFIG_PAX_MEMORY_SANITIZE + for (index = order_size; index; --index) + clear_highpage(page + index - 1); +#endif + zone->free_pages += order_size; while (order < MAX_ORDER-1) { unsigned long combined_idx; @@ -853,7 +858,7 @@ pcp = &zone_pcp(zone, cpu)->pcp[cold]; local_irq_save(flags); if (!pcp->count) { - pcp->count = rmqueue_bulk(zone, 0, + pcp->count += rmqueue_bulk(zone, 0, pcp->batch, &pcp->list); if (unlikely(!pcp->count)) goto failed; @@ -2261,7 +2266,7 @@ /* Account for ranges past physical memory on this node */ if (range_end_pfn > prev_end_pfn) - hole_pages += range_end_pfn - + hole_pages = range_end_pfn - max(range_start_pfn, prev_end_pfn); return hole_pages; @@ -2407,7 +2412,7 @@ zone->zone_pgdat = pgdat; zone->free_pages = 0; - zone->prev_priority = DEF_PRIORITY; + zone->temp_priority = zone->prev_priority = DEF_PRIORITY; zone_pcp_init(zone); INIT_LIST_HEAD(&zone->active_list); @@ -2612,9 +2617,6 @@ { int i; - /* Regions in the early_node_map can be in any order */ - sort_node_map(); - /* Assuming a sorted map, the first range found has the starting pfn */ for_each_active_range_index_in_nid(i, nid) return early_node_map[i].start_pfn; @@ -2683,6 +2685,9 @@ max(max_zone_pfn[i], arch_zone_lowest_possible_pfn[i]); } + /* Regions in the early_node_map can be in any order */ + sort_node_map(); + /* Print out the zone ranges */ printk("Zone PFN ranges:\n"); for (i = 0; i < MAX_NR_ZONES; i++)