From: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
To: Hirokazu Takahashi <taka@valinux.co.jp>
Cc: haveblue@us.ibm.com, raybry@engr.sgi.com, linux-mm@kvack.org
Subject: Re: question on page-migration code
Date: Thu, 14 Apr 2005 12:57:34 -0300 [thread overview]
Message-ID: <20050414155734.GE14975@logos.cnet> (raw)
In-Reply-To: <20050413.194800.74725991.taka@valinux.co.jp>
On Wed, Apr 13, 2005 at 07:48:00PM +0900, Hirokazu Takahashi wrote:
> 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.
>From my understanding there are two problems:
1) PG_private set on file pages whose filesystems do not implement
->migrate_page() method.
Not much can be done about it, except implementing migrate_page() for all
filesystems using page->private for uses other than buffer_head's.
BTW: only ext2/3 are implementing migrate_page(), all buffer_head
based filesystems should do the same on a final version.
Have you guys tried fs'es other than ext2/3?
Dave, I dont understand what you mean with "workaround". The page is
not migratable, thus the memory area which contains it can't
be migrated either.
2) PG_dirty bit set on anonymous pages which have been migrated.
> 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 dirty bit is set by swap allocation and freeing code.
> 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.
Quoting Ray:
"Checking /proc/vmstat/pgpgout appears to indicate that the pages I am
migrating are being swapped out when I see the migration slow down,
although something is fishy with pgpgout."
Anonymous pages seem to the problem Ray is seeing, except (1) which
vanishes with ext2/ext3 as he reports.
Anon pages _should_ be removed from the swapcache at the end of
generic_migrate_page (__remove_exclusive_swap_page()).
So, it does not matter if they have PG_dirty bit set, as long as
they are not swap-allocated (PageSwapCache).
Ray, please confirm that anon pages are removed from the swapcache after
being migrated (watching /proc/meminfo should do it).
One point is that if free memory is below the safe watermarks, the
system will vmscan, allocating swap & writing out, which is expected.
How much memory is free during said tests?
> 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.
The PG_dirty bit is set, by the migration code, for anonymous pages only.
That said, I see no need to reset PG_dirty in case it was not set before
migration, as you propose.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>
next prev parent reply other threads:[~2005-04-14 15:57 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-07 22:16 Ray Bryant
2005-04-07 18:08 ` Marcelo Tosatti
2005-04-11 14:20 ` Ray Bryant
2005-04-11 18:31 ` Ray Bryant
2005-04-11 23:41 ` Hirokazu Takahashi
2005-04-12 4:57 ` Ray Bryant
2005-04-12 5:43 ` Ray Bryant
2005-04-13 2:30 ` IWAMOTO Toshihiro
2005-04-13 4:43 ` Hirokazu Takahashi
2005-04-15 6:41 ` IWAMOTO Toshihiro
2005-04-15 12:53 ` Marcelo Tosatti
2005-04-18 10:37 ` IWAMOTO Toshihiro
2005-04-12 16:46 ` Dave Hansen
2005-04-13 10:48 ` Hirokazu Takahashi
2005-04-14 15:57 ` Marcelo Tosatti [this message]
2005-04-19 2:46 ` Ray Bryant
2005-04-20 18:16 ` Marcelo Tosatti
2005-04-12 19:29 ` Ray Bryant
2005-04-11 19:00 ` Ray Bryant
2005-04-11 19:59 ` Ray Bryant
2005-04-07 22:44 ` Ray Bryant
2005-04-07 23:05 Ray Bryant
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050414155734.GE14975@logos.cnet \
--to=marcelo.tosatti@cyclades.com \
--cc=haveblue@us.ibm.com \
--cc=linux-mm@kvack.org \
--cc=raybry@engr.sgi.com \
--cc=taka@valinux.co.jp \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox