Re: [Lhms-devel] Re: [RFC/PATCH] free_area[] bitmap elimination [3/3]
From: Hiroyuki KAMEZAWA <hidden>
Date: 2004-08-25 00:12:12
Dave Hansen wrote:
On Tue, 2004-08-24 at 05:41, Hiroyuki KAMEZAWA wrote:quoted
+static inline int page_is_buddy(struct page *page, int order) +{ + if (page_count(page) == 0 && + PagePrivate(page) && + !PageReserved(page) && + page_order(page) == order) { + /* check, check... see free_pages_check() */ + if (page_mapped(page) || + page->mapping != NULL || + (page->flags & ( + 1 << PG_lru | + 1 << PG_locked | + 1 << PG_active | + 1 << PG_reclaim | + 1 << PG_slab | + 1 << PG_swapcache | + 1 << PG_writeback ))) + bad_page(__FUNCTION__, page); + return 1; + } + return 0; +}Please share some code with the free_pages_check() that you stole this from. It's nasty enough to have one copy of it around. :)
Hmm... this part is different from free_pages_check() even if I stoled it from. Becasuse PG_private bit check is not done here. Sharing some code with frees_page_check() would make free_pages_check() complex to read. And this is only a bug checking code and bad_page( __FUNCTION__ , page) is useful to test this buddy system.
quoted
+#ifdef CONFIG_VIRTUAL_MEM_MAP + /* This check is necessary when + 1. there may be holes in zone. + 2. a hole is not aligned in this order. + currently, VIRTUAL_MEM_MAP case, is only case. + Is there better call than pfn_valid ? + */ + if (!pfn_valid(zone->zone_start_pfn + (page_idx ^ (1 << order)))) + break; +#endifThis should be hidden in a header somewhere. We don't want to have to see ia64-specific ifdefs in generic code.
Hmm, I understand what you say. I'll consider better another way. But why #ifdef is inserted here is that this is RFC and I want to make it clear this is IA64 specific. Thank you for your all comments. -- Kame -- --the clue is these footmarks leading to the door.-- KAMEZAWA Hiroyuki [off-list ref] -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>