free_area[] bitmap elimination [3/3]
Subsystems (2)
RFC 1/1 free_area[] bitmap elimination [3/3]
This part is for free_pages().
Signature · 2 lines
--the clue is these footmarks leading to the door.-- KAMEZAWA Hiroyuki <[email protected]>
remove bitmap operation from free_pages()
---
linux-2.6.8.1-kame-kamezawa/mm/page_alloc.c | 21 +++++++++++---------- 1 files changed, 11 insertions(+), 10 deletions(-)
mm/page_alloc.c renamed from mm/page_alloc.c~eliminate-bitmap-p04 +11 -10
@@ -181,7 +181,7 @@ static void destroy_compound_page(structstatic inline void __free_pages_bulk (struct page *page,struct page *base,struct zone *zone,struct free_area *area,unsigned int order) { -unsigned long page_idx, index, mask; +unsigned long page_idx, mask;if (order)destroy_compound_page (page, order);
@@ -189,21 +189,21 @@ static inline void __free_pages_bulk (st page_idx = page - base;if (page_idx & ~mask)BUG (); - index = page_idx >> (1 + order); - +set_page_order (page,order); zone->free_pages +=1 << order;while (order <MAX_ORDER -1 ) {struct page *buddy1, *buddy2;BUG_ON (area >= zone->free_area +MAX_ORDER ); -if (!__test_and_change_bit (index, area->map)) -/* -* the buddy page is still allocated. -*/ -break ; -/* Move the buddy up one level. */ buddy1 = base + (page_idx ^ (1 << order)); +BUG_ON (bad_range (zone, buddy1)); +if ((page_count (buddy1) !=0 ) || + (page_order (buddy1) != order) ) +/* +* the buddy is still allocated +*/ +break ; buddy2 = base + page_idx;BUG_ON (bad_range (zone, buddy1));BUG_ON (bad_range (zone, buddy2));
@@ -211,9 +211,9 @@ static inline void __free_pages_bulk (st mask <<=1 ; order++; area++; - index >>=1 ; page_idx &= mask; } +set_page_order ((base + page_idx), order);list_add (&(base + page_idx)->lru, &area->free_list); }
@@ -236,6 +236,7 @@ static inline void free_pages_check(consbad_page (function, page);if (PageDirty (page))ClearPageDirty (page); +invalidate_page_order (page); }/*
_