diff options
author | Yisheng Xie <xieyisheng1@huawei.com> | 2017-02-24 17:57:39 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-02-24 20:46:55 -0500 |
commit | 0efadf48bca01f17cb64ebceaf528590b2bc7665 (patch) | |
tree | 6e0ea09951e9797bf30d96c67c5b9a3712df0035 /mm/page_alloc.c | |
parent | 85fbe5d1b50cf6f83b4123ca28d6fab84275824c (diff) |
mm/hotplug: enable memory hotplug for non-lru movable pages
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>
Cc: Yisheng Xie <xieyisheng1@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r-- | mm/page_alloc.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 41985aa4672d..2d34cdb70f1d 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -7227,8 +7227,9 @@ void *__init alloc_large_system_hash(const char *tablename, | |||
7227 | * If @count is not zero, it is okay to include less @count unmovable pages | 7227 | * If @count is not zero, it is okay to include less @count unmovable pages |
7228 | * | 7228 | * |
7229 | * PageLRU check without isolation or lru_lock could race so that | 7229 | * PageLRU check without isolation or lru_lock could race so that |
7230 | * MIGRATE_MOVABLE block might include unmovable pages. It means you can't | 7230 | * MIGRATE_MOVABLE block might include unmovable pages. And __PageMovable |
7231 | * expect this function should be exact. | 7231 | * check without lock_page also may miss some movable non-lru pages at |
7232 | * race condition. So you can't expect this function should be exact. | ||
7232 | */ | 7233 | */ |
7233 | bool has_unmovable_pages(struct zone *zone, struct page *page, int count, | 7234 | bool has_unmovable_pages(struct zone *zone, struct page *page, int count, |
7234 | bool skip_hwpoisoned_pages) | 7235 | bool skip_hwpoisoned_pages) |
@@ -7284,6 +7285,9 @@ bool has_unmovable_pages(struct zone *zone, struct page *page, int count, | |||
7284 | if (skip_hwpoisoned_pages && PageHWPoison(page)) | 7285 | if (skip_hwpoisoned_pages && PageHWPoison(page)) |
7285 | continue; | 7286 | continue; |
7286 | 7287 | ||
7288 | if (__PageMovable(page)) | ||
7289 | continue; | ||
7290 | |||
7287 | if (!PageLRU(page)) | 7291 | if (!PageLRU(page)) |
7288 | found++; | 7292 | found++; |
7289 | /* | 7293 | /* |