Commit 54608759 authored by Joonsoo Kim's avatar Joonsoo Kim Committed by Linus Torvalds

mm/memory-failure: remove a wrapper for alloc_migration_target()

There is a well-defined standard migration target callback.  Use it
directly.
Signed-off-by: default avatarJoonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Acked-by: default avatarVlastimil Babka <vbabka@suse.cz>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Roman Gushchin <guro@fb.com>
Link: http://lkml.kernel.org/r/1594622517-20681-9-git-send-email-iamjoonsoo.kim@lge.comSigned-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 4127c650
...@@ -1673,16 +1673,6 @@ int unpoison_memory(unsigned long pfn) ...@@ -1673,16 +1673,6 @@ int unpoison_memory(unsigned long pfn)
} }
EXPORT_SYMBOL(unpoison_memory); EXPORT_SYMBOL(unpoison_memory);
static struct page *new_page(struct page *p, unsigned long private)
{
struct migration_target_control mtc = {
.nid = page_to_nid(p),
.gfp_mask = GFP_USER | __GFP_MOVABLE | __GFP_RETRY_MAYFAIL,
};
return alloc_migration_target(p, (unsigned long)&mtc);
}
/* /*
* Safely get reference count of an arbitrary page. * Safely get reference count of an arbitrary page.
* Returns 0 for a free page, -EIO for a zero refcount page * Returns 0 for a free page, -EIO for a zero refcount page
...@@ -1797,6 +1787,10 @@ static int __soft_offline_page(struct page *page) ...@@ -1797,6 +1787,10 @@ static int __soft_offline_page(struct page *page)
char const *msg_page[] = {"page", "hugepage"}; char const *msg_page[] = {"page", "hugepage"};
bool huge = PageHuge(page); bool huge = PageHuge(page);
LIST_HEAD(pagelist); LIST_HEAD(pagelist);
struct migration_target_control mtc = {
.nid = NUMA_NO_NODE,
.gfp_mask = GFP_USER | __GFP_MOVABLE | __GFP_RETRY_MAYFAIL,
};
/* /*
* Check PageHWPoison again inside page lock because PageHWPoison * Check PageHWPoison again inside page lock because PageHWPoison
...@@ -1833,8 +1827,8 @@ static int __soft_offline_page(struct page *page) ...@@ -1833,8 +1827,8 @@ static int __soft_offline_page(struct page *page)
} }
if (isolate_page(hpage, &pagelist)) { if (isolate_page(hpage, &pagelist)) {
ret = migrate_pages(&pagelist, new_page, NULL, MPOL_MF_MOVE_ALL, ret = migrate_pages(&pagelist, alloc_migration_target, NULL,
MIGRATE_SYNC, MR_MEMORY_FAILURE); (unsigned long)&mtc, MIGRATE_SYNC, MR_MEMORY_FAILURE);
if (!ret) { if (!ret) {
bool release = !huge; bool release = !huge;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment