[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-mm
Subject:    Re: [RFC] buddy allocator withou bitmap(2) [3/3]
From:       Dave Hansen <haveblue () us ! ibm ! com>
Date:       2004-08-31 16:35:54
Message-ID: 1093970154.26660.4829.camel () nighthawk
[Download RAW message or body]

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, 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>
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic