Re: question on page-migration code

Hirokazu Takahashi
2005-04-13T10:48:00Z

Hi,

> > If the method isn't implemented for the page, the migration code
> > calls pageout() and try_to_release_page() to release page->private
> > instead.
> >
> > Which filesystem are you using? I guess it might be XFS which
> > doesn't have the method yet.
>
> Can we more easily detect and work around this in the code, so that this
> won't happen for more filesystems?

As Ray said, the following seems to be a straight approach.
I haven't had any other ideas to work around it.

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

The implementation might be as follows:
- to make try_to_unmap_one() record dirty bit in anywhere
instead of calling set_page_dirty().
- to make touch_unmapped_address() call get_user_pages() with
the record of the dirty bit.

However, we have to remember that there must exit some race conditions.
For example, it may fail to restore the dirty bit since the process
address spaces might be deleted during the memory migration.
This may occur as the process isn't suspended during the migration.

Thanks,
Hirokazu Takahashi.