From: Christoph Lameter <clameter@sgi.com>
To: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Nick Piggin <npiggin@suse.de>,
Andrew Morton <akpm@linux-foundation.org>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
GOTO <y-goto@jp.fujitsu.com>
Subject: Re: Warning on memory offline (and possible in usual migration?)
Date: Fri, 2 May 2008 14:16:20 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0805021411260.21677@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0805011833480.13697@schroedinger.engr.sgi.com>
I guess we need the following patch to handle !uptodate pages. Wish we had
a better solution that would allow the skipping of pages with buffers
under read I/O.
Subject: Page migration: Do not migrate page that is not uptodate
If we are migrating pages that are not mapped into a processes address
space then we may encounter !Uptodate pages. Page migration is now used
for offlining memory which scans unmapped pages.
If a page is not uptodate then read I/O may be in progress against it.
So do not migrate it. On the other hand if the page has buffers then
read I/O will lock a buffer. In that case we can migrate an !Uptodate
page but then migration will stall in buffer_migrate_page() until the
read is complete.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
---
mm/migrate.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
Index: linux-2.6/mm/migrate.c
===================================================================
--- linux-2.6.orig/mm/migrate.c 2008-05-02 13:47:45.113707645 -0700
+++ linux-2.6/mm/migrate.c 2008-05-02 14:08:32.203644985 -0700
@@ -652,6 +652,23 @@ static int unmap_and_move(new_page_t get
goto unlock;
wait_on_page_writeback(page);
}
+
+ /*
+ * Page may be under read I/O if its not uptodate and has no buffers.
+ * In that case the page contents are not stable and should not be
+ * migrated. So we just pass on that page and return -EAGAIN.
+ *
+ * If a page has buffers then the locks taken on the buffers
+ * will indicate that read I/O is in progress. Then PageUptodate does
+ * not matter because buffer_migrate_page() will stall until I/O is
+ * complete. It would be better if we could catch that here and delay
+ * migrating the page because we could migrate a the other pages on the
+ * migrate list instead of waiting for I/O to complete on this page
+ * (like done for writes in progress).
+ */
+ if (!PageUptodate(page) && !page_has_buffers(page))
+ goto unlock;
+
/*
* By try_to_unmap(), page->mapcount goes down to 0 here. In this case,
* we cannot notice that anon_vma is freed while we migrates a page.
--
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:[~2008-05-02 21:16 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-14 5:58 KAMEZAWA Hiroyuki
2008-04-14 17:46 ` Christoph Lameter
2008-04-15 10:13 ` KAMEZAWA Hiroyuki
2008-04-15 19:31 ` Christoph Lameter
2008-04-16 0:23 ` KAMEZAWA Hiroyuki
2008-04-16 2:23 ` KAMEZAWA Hiroyuki
2008-04-16 3:10 ` KAMEZAWA Hiroyuki
2008-04-16 5:22 ` KAMEZAWA Hiroyuki
2008-04-16 18:04 ` Christoph Lameter
2008-04-16 11:00 ` KAMEZAWA Hiroyuki
2008-04-16 18:36 ` Andrew Morton
2008-04-17 0:19 ` KAMEZAWA Hiroyuki
2008-04-17 6:38 ` Warning on memory offline (possible in migration ?) KAMEZAWA Hiroyuki
2008-04-17 6:43 ` Andrew Morton
2008-04-17 6:55 ` KAMEZAWA Hiroyuki
2008-04-22 4:41 ` Warning on memory offline (and possible in usual migration?) Nick Piggin
2008-04-22 4:52 ` Nick Piggin
2008-04-22 7:56 ` KAMEZAWA Hiroyuki
2008-04-22 9:43 ` Nick Piggin
2008-04-22 9:57 ` KAMEZAWA Hiroyuki
2008-04-22 19:16 ` Christoph Lameter
2008-04-23 0:48 ` Nick Piggin
2008-04-23 1:37 ` KAMEZAWA Hiroyuki
2008-04-23 2:41 ` KAMEZAWA Hiroyuki
2008-04-23 2:53 ` Nick Piggin
2008-04-23 3:44 ` KAMEZAWA Hiroyuki
2008-04-23 15:28 ` Nick Piggin
2008-04-24 1:34 ` KAMEZAWA Hiroyuki
2008-04-23 17:50 ` Christoph Lameter
2008-04-24 1:36 ` KAMEZAWA Hiroyuki
2008-04-24 19:11 ` Christoph Lameter
2008-04-25 0:11 ` KAMEZAWA Hiroyuki
2008-04-23 17:47 ` Christoph Lameter
2008-04-24 2:13 ` Nick Piggin
2008-04-29 7:20 ` KAMEZAWA Hiroyuki
2008-04-30 6:56 ` Nick Piggin
2008-04-30 7:04 ` KAMEZAWA Hiroyuki
2008-04-30 7:12 ` Andrew Morton
2008-04-30 7:22 ` KAMEZAWA Hiroyuki
2008-04-30 7:26 ` Nick Piggin
2008-04-30 17:59 ` Christoph Lameter
2008-04-30 18:01 ` Christoph Lameter
2008-05-01 1:44 ` Nick Piggin
2008-05-01 19:25 ` Christoph Lameter
2008-05-02 0:44 ` Nick Piggin
2008-05-02 1:07 ` Christoph Lameter
2008-05-02 1:23 ` Nick Piggin
2008-05-02 1:37 ` Christoph Lameter
2008-05-02 21:16 ` Christoph Lameter [this message]
2008-05-05 4:27 ` Nick Piggin
2008-05-05 17:28 ` Christoph Lameter
2008-05-06 8:52 ` Nick Piggin
2008-05-06 17:49 ` Christoph Lameter
2008-04-30 23:29 ` kamezawa.hiroyu
2008-05-01 0:34 ` Badari Pulavarty
2008-05-01 8:36 ` kamezawa.hiroyu
2008-04-22 4:50 ` Nick Piggin
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.0805021411260.21677@schroedinger.engr.sgi.com \
--to=clameter@sgi.com \
--cc=akpm@linux-foundation.org \
--cc=kamezawa.hiroyu@jp.fujitsu.com \
--cc=linux-mm@kvack.org \
--cc=npiggin@suse.de \
--cc=y-goto@jp.fujitsu.com \
/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