From: Hugh Dickins <hughd@google.com>
To: Mel Gorman <mgorman@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>,
riel@redhat.com, sasha.levin@oracle.com,
Bob Liu <bob.liu@oracle.com>, Linux-MM <linux-mm@kvack.org>,
LKML <lkml@vger.kernel.org>
Subject: Re: [PATCH] mm: numa: Add migrated transhuge pages to LRU the same way as base pages
Date: Thu, 24 Apr 2014 12:48:54 -0700 (PDT) [thread overview]
Message-ID: <alpine.LSU.2.11.1404241238180.3362@eggly.anvils> (raw)
In-Reply-To: <20140424153914.GW23991@suse.de>
On Thu, 24 Apr 2014, Mel Gorman wrote:
> 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>
Acked-by: Hugh Dickins <hughd@google.com>
Thanks, Mel: I do feel more comfortable doing it this way, as elsewhere
in migrate.c, whatever the slight drawbacks (I hadn't realized that I
was asking for another get_page, but it's far from the only place where
isolate/putback forces us into that additional superfluous reference:
something to sort out "some other day"). I worried for a bit that you
are doing the putback while holding page lock; but this is not the only
place where that's done (page_remove_rmap may clear_page_mlock though
called under page lock), so no good reason to ask for a change there.
> ---
> 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>
prev parent reply other threads:[~2014-04-24 19:50 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 ` [PATCH] mm: numa: Add migrated transhuge pages to LRU the same way as base pages Mel Gorman
2014-04-24 19:48 ` Hugh Dickins [this message]
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=alpine.LSU.2.11.1404241238180.3362@eggly.anvils \
--to=hughd@google.com \
--cc=akpm@linux-foundation.org \
--cc=bob.liu@oracle.com \
--cc=linux-mm@kvack.org \
--cc=lkml@vger.kernel.org \
--cc=mgorman@suse.de \
--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