Re: question on page-migration code

IWAMOTO Toshihiro
2005-04-13T02:30:17Z

At Tue, 12 Apr 2005 00:43:42 -0500,
Ray Bryant wrote:
> What appears to be happening is the following:
>
> dirty pte bits are being swept into the page dirty bit as a side effect
> of migration. That is, if a page had pte_dirty(pte) set, then after
> migration, it will have PageDirty(page) = true.
>
> Only pages with PageDirty() set will be written to swap as part of the
> process of trying to clear PG_private. So, when I do the first migration,
> the PG_dirty bit is not set on the page, but the dirty bit is set in the
> pte. Because PG_dirty is not set, the page does not get written to swap,
> and the migration is fast. However, at the end of the migration process,
> the pages all have PG_dirty set and the pte dirty bits are cleared.

When I wrote the migration code long ago, I didn't think about such
side effects and just followed the kswapd operation.

> I guess it seems to me that if a page has pte dirty set, but doesn't have
> PG_dirty set, then that state should be carried over to the newpage after
> a migration, rather than sweeping the pte dirty bit into the PG_dirty bit.

I think this is the correct solution.

--
IWAMOTO Toshihiro