Re: [Lhms-devel] Re: [RFC] buddy allocator withou bitmap(2) [3/3]

From: Hiroyuki KAMEZAWA
Date: Tue Aug 31 2004 - 18:32:44 EST


Dave Hansen wrote:

> On Tue, 2004-08-31 at 03:47, Hiroyuki KAMEZAWA wrote:
>
>>"Does a page's buddy page exist or not ?" is checked by following.
>>------------------------
>>if ((address of buddy is smaller than that of page) &&
>> (page->flags & PG_buddyend))
>> this page has no buddy in this order.
>>------------------------
>
>
> What about the top-of-the-zone buddyend pages? Are those covered
> elsewhere?

If zone is not aligned to MAX_ORDER, the top-of-the-zone buddyend pages
are marked as PG_buddyend.
I forget something ?



>>+static inline int page_is_buddy(struct page *page, int order)
>>+{
>>+ if (PagePrivate(page) &&
>>+ (page_order(page) == order) &&
>>+ !(page->flags & (1 << PG_reserved)) &&
>
>
> Please use a macro.
my mistake.

>
>> if (order)
>> destroy_compound_page(page, order);
>>+
>> mask = (~0UL) << order;
>> page_idx = page - base;
>
>
> Repeat after me: No whitespace changes. No whitespace changes. No
> whitespace changes.
>
very sorry ;(


--
--the clue is these footmarks leading to the door.--
KAMEZAWA Hiroyuki <kamezawa.hiroyu@xxxxxxxxxxxxxx>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/