Skip to contentSkip to conversation

free_area[] bitmap elimination [2/3]

RFC New Hiroyuki KAMEZAWA 1 participant 1 message Aug 21, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC 1/1 free_area[] bitmap elimination [2/3]

This part is for alloc_pages()

Signature · 2 lines
--the clue is these footmarks leading to the door.--
KAMEZAWA Hiroyuki <[email protected]>

removing bitmap operation in page allocation.

---

 linux-2.6.8.1-kame-kamezawa/mm/page_alloc.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
mm/page_alloc.c renamed from mm/page_alloc.c~eliminate-bitmap-p03 +2 -6
diff -puN mm/page_alloc.c~eliminate-bitmap-p03 mm/page_alloc.c
@@ -287,8 +287,6 @@ void __free_pages_ok(struct page *page, 
 	free_pages_bulk(page_zone(page), 1, &list, order);
 }
 
-#define MARK_USED(index, order, area) \
-	__change_bit((index) >> (1+(order)), (area)->map)
 
 /*
  * The order of subdivision here is critical for the IO subsystem.
@@ -315,9 +313,10 @@ expand(struct zone *zone, struct page *p
 		high--;
 		size >>= 1;
 		BUG_ON(bad_range(zone, &page[size]));
+		set_page_order(&page[size],high);
 		list_add(&page[size].lru, &area->free_list);
-		MARK_USED(index + size, high, area);
 	}
+	invalidate_page_order(page);
 	return page;
 }
 
@@ -378,12 +377,9 @@ static struct page *__rmqueue(struct zon
 		area = zone->free_area + current_order;
 		if (list_empty(&area->free_list))
 			continue;
-
 		page = list_entry(area->free_list.next, struct page, lru);
 		list_del(&page->lru);
 		index = page - zone->zone_mem_map;
-		if (current_order != MAX_ORDER-1)
-			MARK_USED(index, current_order, area);
 		zone->free_pages -= 1UL << order;
 		return expand(zone, page, index, order, current_order, area);
 	}

_