From: Christoph Lameter <clameter@sgi.com>
To: Hugh Dickins <hugh@veritas.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>,
Andrew Morton <akpm@osdl.org>,
linux-mm@kvack.org
Subject: Re: [PATCH 2.6.17-rc1-mm3] add migratepage addresss space op to shmem
Date: Mon, 24 Apr 2006 15:04:30 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0604241447520.8904@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0604242046120.24647@blonde.wat.veritas.com>
On Mon, 24 Apr 2006, Hugh Dickins wrote:
> > In 2.6.16 through 2.6.17-rc1, shared memory mappings do not
> > have a migratepage address space op. Therefore, migrate_pages()
> > falls back to default processing. In this path, it will try to
> > pageout() dirty pages. Once a shared memory page has been migrated
> > it becomes dirty, so migrate_pages() will try to page it out.
> > However, because the page count is 3 [cache + current + pte],
> > pageout() will return PAGE_KEEP because is_page_cache_freeable()
> > returns false. This will abort all subsequent migrations.
>
> So far as I can see, this problem is not at all peculiar to shmem
> (aside from its greater likelihood of being found PageDirty): won't
> that PageDirty pageout in migrate_pages always return PAGE_KEEP?
> so as it stands, is pointless and misleading?
Yes, this wont work if we do not remove the ptes before calling
pageout. A call to try_to_umap() is missing.
> > This patch adds a migratepage address space op to shared memory
> > segments to avoid taking the default path. We use the "migrate_page()"
> > function because it knows how to migrate dirty pages. This allows
> > shared memory segment pages to migrate, subject to other conditions
> > such as # pte's referencing the page [page_mapcount(page)], when
> > requested.
>
> While that's not wrong, wouldn't the right fix be something else?
His patch avoids going through the fallback functions and allows
migrating dirty shmem pages without pageout. That is good.
Index: linux-2.6/mm/migrate.c
===================================================================
--- linux-2.6.orig/mm/migrate.c 2006-04-18 12:51:31.000000000 -0700
+++ linux-2.6/mm/migrate.c 2006-04-24 15:03:10.000000000 -0700
@@ -439,6 +439,11 @@ redo:
goto unlock_both;
}
+ if (try_to_unmap(page, 1) == SWAP_FAIL) {
+ rc = -EPERM;
+ goto unlock_both;
+ }
+
/*
* Default handling if a filesystem does not provide
* a migration function. We can only migrate clean
--
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:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2006-04-24 22:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-24 20:08 [PATCH 2.6.17-rc1-mm3] add migratepage addresss space op to shmem Hugh Dickins
2006-04-24 22:04 ` Christoph Lameter [this message]
2006-04-25 10:58 ` Hugh Dickins
2006-04-25 16:09 ` Christoph Lameter
2006-04-27 23:05 ` Christoph Lameter
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=Pine.LNX.4.64.0604241447520.8904@schroedinger.engr.sgi.com \
--to=clameter@sgi.com \
--cc=Lee.Schermerhorn@hp.com \
--cc=akpm@osdl.org \
--cc=hugh@veritas.com \
--cc=linux-mm@kvack.org \
/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;
as well as URLs for NNTP newsgroup(s).