From: Yisheng Xie <xieyisheng1@huawei.com>
To: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: "linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"mhocko@kernel.org" <mhocko@kernel.org>,
"minchan@kernel.org" <minchan@kernel.org>,
"ak@linux.intel.com" <ak@linux.intel.com>,
"guohanjun@huawei.com" <guohanjun@huawei.com>,
"hannes@cmpxchg.org" <hannes@cmpxchg.org>,
"iamjoonsoo.kim@lge.com" <iamjoonsoo.kim@lge.com>,
"mgorman@techsingularity.net" <mgorman@techsingularity.net>,
"arbab@linux.vnet.ibm.com" <arbab@linux.vnet.ibm.com>,
"izumi.taku@jp.fujitsu.com" <izumi.taku@jp.fujitsu.com>,
"vkuznets@redhat.com" <vkuznets@redhat.com>,
"vbabka@suse.cz" <vbabka@suse.cz>,
"qiuxishi@huawei.com" <qiuxishi@huawei.com>
Subject: Re: [PATCH v6 4/4] mm/hotplug: enable memory hotplug for non-lru movable pages
Date: Mon, 6 Feb 2017 12:25:12 +0800 [thread overview]
Message-ID: <58cd9f5c-9a66-ea12-89dd-182650dfe323@huawei.com> (raw)
In-Reply-To: <20170206032951.GA1659@hori1.linux.bs1.fc.nec.co.jp>
Hi Naoya Horiguchi,
Thanks for reviewing.
On 2017/2/6 11:29, Naoya Horiguchi wrote:
> On Fri, Feb 03, 2017 at 03:59:30PM +0800, Yisheng Xie wrote:
>> We had considered all of the non-lru pages as unmovable before commit
>> bda807d44454 ("mm: migrate: support non-lru movable page migration"). But
>> now some of non-lru pages like zsmalloc, virtio-balloon pages also become
>> movable. So we can offline such blocks by using non-lru page migration.
>>
>> This patch straightforwardly adds non-lru migration code, which means
>> adding non-lru related code to the functions which scan over pfn and
>> collect pages to be migrated and isolate them before migration.
>>
>> Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com>
>> Cc: Michal Hocko <mhocko@kernel.org>
>> Cc: Minchan Kim <minchan@kernel.org>
>> Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
>> Cc: Vlastimil Babka <vbabka@suse.cz>
>> Cc: Andi Kleen <ak@linux.intel.com>
>> Cc: Hanjun Guo <guohanjun@huawei.com>
>> Cc: Johannes Weiner <hannes@cmpxchg.org>
>> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
>> Cc: Mel Gorman <mgorman@techsingularity.net>
>> Cc: Reza Arbab <arbab@linux.vnet.ibm.com>
>> Cc: Taku Izumi <izumi.taku@jp.fujitsu.com>
>> Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
>> Cc: Xishi Qiu <qiuxishi@huawei.com>
>> ---
>> mm/memory_hotplug.c | 28 +++++++++++++++++-----------
>> mm/page_alloc.c | 8 ++++++--
>> 2 files changed, 23 insertions(+), 13 deletions(-)
>>
>> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
>> index ca2723d..ea1be08 100644
>> --- a/mm/memory_hotplug.c
>> +++ b/mm/memory_hotplug.c
>> @@ -1516,10 +1516,10 @@ int test_pages_in_a_zone(unsigned long start_pfn, unsigned long end_pfn)
>> }
>>
>> /*
>> - * Scan pfn range [start,end) to find movable/migratable pages (LRU pages
>> - * and hugepages). We scan pfn because it's much easier than scanning over
>> - * linked list. This function returns the pfn of the first found movable
>> - * page if it's found, otherwise 0.
>> + * Scan pfn range [start,end) to find movable/migratable pages (LRU pages,
>> + * non-lru movable pages and hugepages). We scan pfn because it's much
>> + * easier than scanning over linked list. This function returns the pfn
>> + * of the first found movable page if it's found, otherwise 0.
>> */
>> static unsigned long scan_movable_pages(unsigned long start, unsigned long end)
>> {
>> @@ -1530,6 +1530,8 @@ static unsigned long scan_movable_pages(unsigned long start, unsigned long end)
>> page = pfn_to_page(pfn);
>> if (PageLRU(page))
>> return pfn;
>> + if (__PageMovable(page))
>> + return pfn;
>> if (PageHuge(page)) {
>> if (page_huge_active(page))
>> return pfn;
>> @@ -1606,21 +1608,25 @@ static struct page *new_node_page(struct page *page, unsigned long private,
>> if (!get_page_unless_zero(page))
>> continue;
>> /*
>> - * We can skip free pages. And we can only deal with pages on
>> - * LRU.
>> + * We can skip free pages. And we can deal with pages on
>> + * LRU and non-lru movable pages.
>> */
>> - ret = isolate_lru_page(page);
>> + if (PageLRU(page))
>> + ret = isolate_lru_page(page);
>> + else
>> + ret = isolate_movable_page(page, ISOLATE_UNEVICTABLE);
>> if (!ret) { /* Success */
>> put_page(page);
>> list_add_tail(&page->lru, &source);
>> move_pages--;
>> - inc_node_page_state(page, NR_ISOLATED_ANON +
>> - page_is_file_cache(page));
>> + if (!__PageMovable(page))
>
> If this check is identical with "if (PageLRU(page))" in this context,
> PageLRU(page) looks better because you already add same "if" above.
>
After isolated lru page, the PageLRU will be cleared, so use !__PageMovable
instead here for LRU page's mapping cannot have PAGE_MAPPING_MOVABLE.
I have add the comment in PATCH[3/4] HWPOISON: soft offlining for non-lru
movable page, so I do not add the same comment here.
Thanks
Yisheng Xie
> Otherwise, looks good to me.
>
> Thanks,
> Naoya Horiguchi
> .
>
prev parent reply other threads:[~2017-02-06 4:32 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-03 7:59 [PATCH v6 0/4] HWPOISON: soft offlining for non-lru movable page Yisheng Xie
2017-02-03 7:59 ` [PATCH v6 1/4] mm/migration: make isolate_movable_page() return int type Yisheng Xie
2017-02-07 0:33 ` Minchan Kim
2017-02-03 7:59 ` [PATCH v6 2/4] mm/migration: make isolate_movable_page always defined Yisheng Xie
2017-02-03 7:59 ` [PATCH v6 3/4] HWPOISON: soft offlining for non-lru movable page Yisheng Xie
2017-02-03 7:59 ` [PATCH v6 4/4] mm/hotplug: enable memory hotplug for non-lru movable pages Yisheng Xie
2017-02-06 3:29 ` Naoya Horiguchi
2017-02-06 4:25 ` Yisheng Xie [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=58cd9f5c-9a66-ea12-89dd-182650dfe323@huawei.com \
--to=xieyisheng1@huawei.com \
--cc=ak@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=arbab@linux.vnet.ibm.com \
--cc=guohanjun@huawei.com \
--cc=hannes@cmpxchg.org \
--cc=iamjoonsoo.kim@lge.com \
--cc=izumi.taku@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
--cc=mhocko@kernel.org \
--cc=minchan@kernel.org \
--cc=n-horiguchi@ah.jp.nec.com \
--cc=qiuxishi@huawei.com \
--cc=vbabka@suse.cz \
--cc=vkuznets@redhat.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
all inboxes | Powered by JetHome®