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

From: Dave Hansen
Date: Tue Aug 31 2004 - 11:39:54 EST


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?

> +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.

> 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.

-- Dave

-
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/