Re: [PATCH 5/8] Direct Migration V2: upgrade MPOL_MF_MOVE and sys_migrate_pages()

KAMEZAWA Hiroyuki
2005-11-09T03:59:34Z

Christoph Lameter wrote:
> On Wed, 9 Nov 2005, KAMEZAWA Hiroyuki wrote:
>
>
>>Christoph Lameter wrote:
>>
>>>+ err = migrate_pages(pagelist, &newlist, &moved, &failed);
>>>+
>>>+ putback_lru_pages(&moved); /* Call release pages instead ?? */
>>>+
>>>+ if (err >= 0 && list_empty(&newlist) && !list_empty(pagelist))
>>>+ goto redo;
>>
>>
>>Here, list_empty(&newlist) is needed ?
>>For checking permanent failure case, list_empty(&failed) looks better.
>
>
> We only allocate 256 pages which are on the newlist. If the newlist is
> empty but there are still pages that could be migrated
> (!list_empty(pagelist)) then we need to allocate more pages and call
> migrate_pages() again.
>
>
Ah, Okay.

confirmation:
1. Because mm->sem is held, there is no page-is-truncated/freed case.
2. Because pages in pagelist are removed from zone's lru, kswapd and others will not
find and unmap them. There is no page-is-swapedout-by-others case.

So if all target pages are successfuly remvoed from pagelist, newlist must be empty.
Right ?

-- Kame