Re: question on page-migration code

IWAMOTO Toshihiro
2005-04-18T10:37:35Z

Hi,

At Fri, 15 Apr 2005 09:53:55 -0300,
Marcelo Tosatti wrote:
> On Fri, Apr 15, 2005 at 03:41:38PM +0900, IWAMOTO Toshihiro wrote:
> > At Thu, 14 Apr 2005 12:57:34 -0300,
> > Marcelo Tosatti wrote:

> > > That said, I see no need to reset PG_dirty in case it was not set before
> > > migration, as you propose.
> >
> > I think PG_dirty should be reset, as the side effect is probably
> > unacceptable for Ray's application. It would be a bit more
> > complicated than just changing page and PTE bits, but I think it's
> > doable.
>
> Yes, makes sense.
>
> Question: Who is causing the writeouts here?
>
> Is there memory pressure or is it pdflush?
>
> Its not the migration code? (that would be a problem I think).

If I understand correctly, writebacks happen in the following way.

1. The migration code unmaps dirty PTEs.
2. try_to_unmap() calls set_page_dirty() for such pages, setting
PG_dirty and the dirty radix tree tag.
3. When pdflush is woken, it calls do_writepages().
4. At least for ext2 (I assume it is true for most file systems),
do_writepage() calls result in mpage_writepages() calls, which scan
radix trees for dirty tags.

--
IWAMOTO Toshihiro