Thread (3 messages) 3 messages, 2 authors, 2004-08-31

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

From: Dave Hansen <hidden>
Date: 2004-08-31 16:36:45
Also in: lkml

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>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help