From: Mel Gorman <mgorman@suse.de>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: riel@redhat.com, sasha.levin@oracle.com,
Bob Liu <bob.liu@oracle.com>, Hugh Dickins <hughd@google.com>,
Linux-MM <linux-mm@kvack.org>, LKML <lkml@vger.kernel.org>
Subject: [PATCH] mm: numa: Add migrated transhuge pages to LRU the same way as base pages
Date: Thu, 24 Apr 2014 16:39:14 +0100 [thread overview]
Message-ID: <20140424153914.GW23991@suse.de> (raw)
In-Reply-To: <alpine.LSU.2.11.1404042358030.12542@eggly.anvils>
Migration of misplaced transhuge pages uses page_add_new_anon_rmap() when
putting the page back as it avoided an atomic operations and added the
new page to the correct LRU. A side-effect is that the page gets marked
activated as part of the migration meaning that transhuge and base pages
are treated differently from an aging perspective than base page migration.
This patch uses page_add_anon_rmap() and putback_lru_page() on completion of
a transhuge migration similar to base page migration. It would fewer atomic
operations to use lru_cache_add without taking an additional reference to the
page. The downside would be that it's still different to base page migration
and unevictable pages may be added to the wrong LRU for cleaning up later.
Testing of the usual workloads did not show any adverse impact to the
change.
Signed-off-by: Mel Gorman <mgorman@suse.de>
---
mm/migrate.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/mm/migrate.c b/mm/migrate.c
index bed4880..6247be7 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1852,7 +1852,7 @@ fail_putback:
* guarantee the copy is visible before the pagetable update.
*/
flush_cache_range(vma, mmun_start, mmun_end);
- page_add_new_anon_rmap(new_page, vma, mmun_start);
+ page_add_anon_rmap(new_page, vma, mmun_start);
pmdp_clear_flush(vma, mmun_start, pmd);
set_pmd_at(mm, mmun_start, pmd, entry);
flush_tlb_range(vma, mmun_start, mmun_end);
@@ -1877,6 +1877,10 @@ fail_putback:
spin_unlock(ptl);
mmu_notifier_invalidate_range_end(mm, mmun_start, mmun_end);
+ /* Take an "isolate" reference and put new page on the LRU. */
+ get_page(new_page);
+ putback_lru_page(new_page);
+
unlock_page(new_page);
unlock_page(page);
put_page(page); /* Drop the rmap reference */
--
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:[~2014-04-24 15:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-31 3:07 [PATCH] mm: rmap: don't try to add an unevictable page to lru list Bob Liu
2014-04-05 9:04 ` Hugh Dickins
2014-04-08 8:58 ` Bob Liu
2014-04-24 3:08 ` Hugh Dickins
2014-04-24 3:23 ` Bob Liu
2014-04-24 15:39 ` Mel Gorman [this message]
2014-04-24 19:48 ` [PATCH] mm: numa: Add migrated transhuge pages to LRU the same way as base pages Hugh Dickins
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=20140424153914.GW23991@suse.de \
--to=mgorman@suse.de \
--cc=akpm@linux-foundation.org \
--cc=bob.liu@oracle.com \
--cc=hughd@google.com \
--cc=linux-mm@kvack.org \
--cc=lkml@vger.kernel.org \
--cc=riel@redhat.com \
--cc=sasha.levin@oracle.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;
as well as URLs for NNTP newsgroup(s).