[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <55143FF5-ED23-4DC8-811C-D31AE254C38E@sent.com>
Date: Thu, 09 Feb 2017 11:37:46 -0600
From: "Zi Yan" <zi.yan@...t.com>
To: "Naoya Horiguchi" <n-horiguchi@...jp.nec.com>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"kirill.shutemov@...ux.intel.com" <kirill.shutemov@...ux.intel.com>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"minchan@...nel.org" <minchan@...nel.org>,
"vbabka@...e.cz" <vbabka@...e.cz>,
"mgorman@...hsingularity.net" <mgorman@...hsingularity.net>,
"khandual@...ux.vnet.ibm.com" <khandual@...ux.vnet.ibm.com>
Subject: Re: [PATCH v3 13/14] mm: migrate: move_pages() supports thp migration
On 9 Feb 2017, at 3:16, Naoya Horiguchi wrote:
> On Sun, Feb 05, 2017 at 11:12:51AM -0500, Zi Yan wrote:
>> From: Naoya Horiguchi <n-horiguchi@...jp.nec.com>
>>
>> This patch enables thp migration for move_pages(2).
>>
>> Signed-off-by: Naoya Horiguchi <n-horiguchi@...jp.nec.com>
>> ---
>> mm/migrate.c | 37 ++++++++++++++++++++++++++++---------
>> 1 file changed, 28 insertions(+), 9 deletions(-)
>>
>> diff --git a/mm/migrate.c b/mm/migrate.c
>> index 84181a3668c6..9bcaccb481ac 100644
>> --- a/mm/migrate.c
>> +++ b/mm/migrate.c
>> @@ -1413,7 +1413,17 @@ static struct page *new_page_node(struct page *p, unsigned long private,
>> if (PageHuge(p))
>> return alloc_huge_page_node(page_hstate(compound_head(p)),
>> pm->node);
>> - else
>> + else if (thp_migration_supported() && PageTransHuge(p)) {
>> + struct page *thp;
>> +
>> + thp = alloc_pages_node(pm->node,
>> + (GFP_TRANSHUGE | __GFP_THISNODE) & ~__GFP_RECLAIM,
>> + HPAGE_PMD_ORDER);
>> + if (!thp)
>> + return NULL;
>> + prep_transhuge_page(thp);
>> + return thp;
>> + } else
>> return __alloc_pages_node(pm->node,
>> GFP_HIGHUSER_MOVABLE | __GFP_THISNODE, 0);
>> }
>> @@ -1440,6 +1450,8 @@ static int do_move_page_to_node_array(struct mm_struct *mm,
>> for (pp = pm; pp->node != MAX_NUMNODES; pp++) {
>> struct vm_area_struct *vma;
>> struct page *page;
>> + struct page *head;
>> + unsigned int follflags;
>>
>> err = -EFAULT;
>> vma = find_vma(mm, pp->addr);
>> @@ -1447,8 +1459,10 @@ static int do_move_page_to_node_array(struct mm_struct *mm,
>> goto set_status;
>>
>> /* FOLL_DUMP to ignore special (like zero) pages */
>> - page = follow_page(vma, pp->addr,
>> - FOLL_GET | FOLL_SPLIT | FOLL_DUMP);
>> + follflags = FOLL_GET | FOLL_SPLIT | FOLL_DUMP;
>
> FOLL_SPLIT should be added depending on thp_migration_supported().
Sure. I will fix it.
--
Best Regards
Yan Zi
Download attachment "signature.asc" of type "application/pgp-signature" (497 bytes)
Powered by blists - more mailing lists