Re: [Lhms-devel] [RFC] free_area[] bitmap elimination [0/3]

Hirokazu Takahashi
2004-08-24T02:28:47Z

Hi,

Your approach seems much better than mine for hotplug-memory.

> > The use of page_count()==0 is a little worrisome. There's almost
> > certainly some race conditions where a page can be mistaken for free
> > while it's page_count()==0, but before it's reached free_pages_bulk().
> >
> > BTW, even if page_count()==0 isn't a valid check like you fear, you
> > could always steal a bit in the page->flags. Check out
> > free_pages_check() in mm/page_alloc.c for a nice summary of what state
> > pages have to be in before they're freed.
> >
> Thanks for your comment.
>
> In this patch, "whether a page is free and in buddy allocator ?" is confirmed by
> page_count(page) == 0 and page_order(page) == valid_order.
> A valid_order is a value between (unsigned long)~0 - (unsigned long)~(MAX_ORDER)
>
> But there may be pages which have vague page->private and conflict with my
> buddy page checking.
> I'd like to read free_pages_check() more and take page->flags into account.

This may have a good side effect.

If we can distinguish pages in the free_area lists from others precisely
and we can know order of the pages, we could capture pages without
traversing all pages in the free_area lists when removing a memory-section.
remove_page_freearea() Bradley Christiansen wrote would work more
effectively.

Thank you,
Hirokazu Takahashi.