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

Hiroyuki KAMEZAWA
2004-08-24T03:26:24Z

Dave Hansen wrote:

>>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.
>
>
> I'm not saying that there *is* a bug with your code, just that
> page->private has no *guarantees* about its contents, and there *can* be
> a bug under certain conditions. You rely on it not having particular
> values but, since there are no checks and no zeroing, you really can't
> assume anything. Try setting page->private to random values just before
> the free pages check, and I bet you'll eventually get some oopses.
>
you are right.
my patches doesn't check and clear page->private before calling
free_pages_bulk().

> So, either don't rely on page->private for page_order(), or zero out
> page->private before you zero the count. Also, since you might
> effectively be using one of these fields as a pseudo lock, make sure to
> take memory ordering into account. Unless it's an atomic function with
> a test, things can get reordered quite easily.
>

I'd like to fix problems in the next patch, thank you for your advise :).

--Kame

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