From: Shaohua Li <shaohua.li@intel.com>
To: Christoph Lameter <clameter@sgi.com>
Cc: lkml <linux-kernel@vger.kernel.org>,
Nick Piggin <nickpiggin@yahoo.com.au>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [RFC] some page can't be migrated
Date: Fri, 25 Jan 2008 11:59:50 +0800 [thread overview]
Message-ID: <1201233590.28282.13.camel@sli10-desk.sh.intel.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0801241931500.32043@schroedinger.engr.sgi.com>
On Thu, 2008-01-24 at 19:37 -0800, Christoph Lameter wrote:
> On Wed, 23 Jan 2008, Shaohua Li wrote:
>
> > +
> > + /*
> > + * See truncate_complete_page(). Anonymous page might have
> > + * fs-private metadata, the page is truncated. Such page can't be
> > + * migrated. Try to free metadata, so the page can be freed.
> > + */
>
> Well maybe you should change the comment to refer to an orphaned page.
> That is what Nick used. Also change the comment in truncate_complete_page.
> Anonymous page is confusing here because you check that it is *not* an
> anonymous page.
>
> > + if (!page->mapping && !PageAnon(page) && PagePrivate(page)) {
> > + try_to_release_page(page, GFP_KERNEL);
> > + goto unlock;
> > + }
> > +
>
>
> Could you move that into the corner case handling that follows?
>
> So it would be something like
>
> if (!page->mapping) {
> if (!PageAnon(page) && PagePrivate(page))
> try_to_relase_page(page, GFP_KERNEL);
> goto rcu_unlock;
> }
Ok, changed.
Orphaned page might have fs-private metadata, the page is truncated. As
the page hasn't mapping, page migration refuse to migrate the page. It
appears the page is only freed in page reclaim and if zone watermark is
low, the page is never freed, as a result migration always fail. I
thought we could free the metadata so such page can be freed in
migration and make migration more reliable.
Signed-off-by: Shaohua Li <shaohua.li@intel.com>
diff --git a/mm/migrate.c b/mm/migrate.c
index 6a207e8..e82acc9 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -652,8 +652,16 @@ static int unmap_and_move(new_page_t get_new_page, unsigned long private,
* Calling try_to_unmap() against a page->mapping==NULL page is
* BUG. So handle it here.
*/
- if (!page->mapping)
+ if (!page->mapping) {
+ /*
+ * See truncate_complete_page(). Orphaned page might have
+ * fs-private metadata, the page is truncated. Such page can't
+ * be migrated. Try to free metadata, so the page can be freed.
+ */
+ if (!PageAnon(page) && PagePrivate(page))
+ try_to_release_page(page, GFP_KERNEL);
goto rcu_unlock;
+ }
/* Establish migration ptes or remove ptes */
try_to_unmap(page, 1);
diff --git a/mm/truncate.c b/mm/truncate.c
index cadc156..62fd8cd 100644
--- a/mm/truncate.c
+++ b/mm/truncate.c
@@ -84,7 +84,7 @@ EXPORT_SYMBOL(cancel_dirty_page);
/*
* If truncate cannot remove the fs-private metadata from the page, the page
- * becomes anonymous. It will be left on the LRU and may even be mapped into
+ * becomes orphaned. It will be left on the LRU and may even be mapped into
* user pagetables if we're racing with filemap_fault().
*
* We need to bale out if page->mapping is no longer equal to the original
next prev parent reply other threads:[~2008-01-25 3:58 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-23 6:22 Shaohua Li
2008-01-25 3:03 ` Nick Piggin
2008-01-25 3:09 ` Christoph Lameter
2008-01-25 3:09 ` Shaohua Li
2008-01-25 3:12 ` Christoph Lameter
2008-01-25 3:18 ` Shaohua Li
2008-01-25 5:20 ` Nick Piggin
2008-01-25 3:37 ` Christoph Lameter
2008-01-25 3:59 ` Shaohua Li [this message]
2008-01-25 4:01 ` Christoph Lameter
2008-01-25 4:17 ` Nick Piggin
2008-01-25 4:42 ` Christoph Lameter
2008-01-25 6:03 ` Shaohua Li
2008-01-27 6:03 ` Andrew Morton
2008-01-28 1:43 ` Nick Piggin
2008-01-28 1:48 ` Shaohua Li
2008-01-28 19:09 ` Christoph Lameter
2008-01-28 23:17 ` 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=1201233590.28282.13.camel@sli10-desk.sh.intel.com \
--to=shaohua.li@intel.com \
--cc=akpm@linux-foundation.org \
--cc=clameter@sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nickpiggin@yahoo.com.au \
/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
all inboxes | Powered by JetHome®