Index: linux-2.6.16-rc1-mm3/mm/page_alloc.c =================================================================== --- linux-2.6.16-rc1-mm3.orig/mm/page_alloc.c 2006-01-25 17:04:03.000000000 -0800 +++ linux-2.6.16-rc1-mm3/mm/page_alloc.c 2006-01-25 17:14:00.000000000 -0800 @@ -231,8 +231,10 @@ static inline unsigned long page_order(s return page_private(page); } -static inline void set_page_order(struct page *page, int order) { - set_page_private(page, order); +#define AREA_SHIFT 16 + +static inline void set_page_order(struct page *page, int order, int area) { + set_page_private(page, order + (area << AREA_SHIFT)); __SetPagePrivate(page); } @@ -354,7 +356,7 @@ static inline void __free_one_page(struc page_idx = combined_idx; order++; } - set_page_order(page, order); + set_page_order(page, order, area); list_add(&page->lru, &zone->free_area[area][order].free_list); zone->free_area[area][order].nr_free++; } @@ -493,18 +495,18 @@ void fastcall __init __free_pages_bootme * -- wli */ static inline void expand(struct zone *zone, struct page *page, - int low, int high, struct free_area *area) + int low, int high, struct free_area *free_area, int area) { unsigned long size = 1 << high; while (high > low) { - area--; + free_area--; high--; size >>= 1; BUG_ON(bad_range(zone, &page[size])); - list_add(&page[size].lru, &area->free_list); - area->nr_free++; - set_page_order(&page[size], high); + list_add(&page[size].lru, &free_area->free_list); + free_area->nr_free++; + set_page_order(&page[size], high, area); } } @@ -565,7 +567,7 @@ static struct page *__rmqueue(struct zon rmv_page_order(page); free_area->nr_free--; zone->free_pages -= 1UL << order; - expand(zone, page, order, current_order, free_area); + expand(zone, page, order, current_order, free_area, area); return page; } Index: linux-2.6.16-rc1-mm3/include/linux/mmzone.h =================================================================== --- linux-2.6.16-rc1-mm3.orig/include/linux/mmzone.h 2006-01-25 17:03:22.000000000 -0800 +++ linux-2.6.16-rc1-mm3/include/linux/mmzone.h 2006-01-25 17:09:52.000000000 -0800 @@ -22,9 +22,19 @@ #define MAX_ORDER CONFIG_FORCE_MAX_ZONEORDER #endif -#define NR_PER_CPU_PAGES 2 +#define NR_PER_CPU_PAGES 3 + +/* Types of per cpu pages */ +#define PER_CPU_HOT 0 +#define PER_CPU_COLD 1 +#define PER_CPU_ZERO 2 + #define NR_FREE_AREAS 1 +/* Types of free areas */ +#define FREE_AREA_DEFAULT 0 +#define FREE_AREA_ZEROED 1 + struct free_area { struct list_head free_list; unsigned long nr_free; @@ -55,7 +65,7 @@ struct per_cpu_pages { }; struct per_cpu_pageset { - struct per_cpu_pages pcp[NR_PER_CPU_PAGES]; /* 0: hot. 1: cold */ + struct per_cpu_pages pcp[NR_PER_CPU_PAGES]; #ifdef CONFIG_NUMA unsigned long numa_hit; /* allocated in intended node */ unsigned long numa_miss; /* allocated in non intended node */