Skip to content

Commit 666feb2

Browse files
Michal Hockotorvalds
authored andcommitted
mm, migrate: remove reason argument from new_page_t
No allocation callback is using this argument anymore. new_page_node used to use this parameter to convey node_id resp. migration error up to move_pages code (do_move_page_to_node_array). The error status never made it into the final status field and we have a better way to communicate node id to the status field now. All other allocation callbacks simply ignored the argument so we can drop it finally. [mhocko@suse.com: fix migration callback] Link: http://lkml.kernel.org/r/20180105085259.GH2801@dhcp22.suse.cz [akpm@linux-foundation.org: fix alloc_misplaced_dst_page()] [mhocko@kernel.org: fix build] Link: http://lkml.kernel.org/r/20180103091134.GB11319@dhcp22.suse.cz Link: http://lkml.kernel.org/r/20180103082555.14592-3-mhocko@kernel.org Signed-off-by: Michal Hocko <mhocko@suse.com> Reviewed-by: Zi Yan <zi.yan@cs.rutgers.edu> Cc: Andrea Reale <ar@linux.vnet.ibm.com> Cc: Anshuman Khandual <khandual@linux.vnet.ibm.com> Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Mike Kravetz <mike.kravetz@oracle.com> Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> Cc: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent a49bd4d commit 666feb2

File tree

10 files changed

+14
-35
lines changed

10 files changed

+14
-35
lines changed

arch/powerpc/mm/mmu_context_iommu.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ EXPORT_SYMBOL_GPL(mm_iommu_preregistered);
7575
/*
7676
* Taken from alloc_migrate_target with changes to remove CMA allocations
7777
*/
78-
struct page *new_iommu_non_cma_page(struct page *page, unsigned long private,
79-
int **resultp)
78+
struct page *new_iommu_non_cma_page(struct page *page, unsigned long private)
8079
{
8180
gfp_t gfp_mask = GFP_USER;
8281
struct page *new_page;

include/linux/migrate.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
#include <linux/migrate_mode.h>
88
#include <linux/hugetlb.h>
99

10-
typedef struct page *new_page_t(struct page *page, unsigned long private,
11-
int **reason);
10+
typedef struct page *new_page_t(struct page *page, unsigned long private);
1211
typedef void free_page_t(struct page *page, unsigned long private);
1312

1413
/*

include/linux/page-isolation.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
6363
int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn,
6464
bool skip_hwpoisoned_pages);
6565

66-
struct page *alloc_migrate_target(struct page *page, unsigned long private,
67-
int **resultp);
66+
struct page *alloc_migrate_target(struct page *page, unsigned long private);
6867

6968
#endif

mm/compaction.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,8 +1166,7 @@ static void isolate_freepages(struct compact_control *cc)
11661166
* from the isolated freelists in the block we are migrating to.
11671167
*/
11681168
static struct page *compaction_alloc(struct page *migratepage,
1169-
unsigned long data,
1170-
int **result)
1169+
unsigned long data)
11711170
{
11721171
struct compact_control *cc = (struct compact_control *)data;
11731172
struct page *freepage;

mm/internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,5 +538,5 @@ static inline bool is_migrate_highatomic_page(struct page *page)
538538
}
539539

540540
void setup_zone_pageset(struct zone *zone);
541-
extern struct page *alloc_new_node_page(struct page *page, unsigned long node, int **x);
541+
extern struct page *alloc_new_node_page(struct page *page, unsigned long node);
542542
#endif /* __MM_INTERNAL_H */

mm/memory-failure.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1487,7 +1487,7 @@ int unpoison_memory(unsigned long pfn)
14871487
}
14881488
EXPORT_SYMBOL(unpoison_memory);
14891489

1490-
static struct page *new_page(struct page *p, unsigned long private, int **x)
1490+
static struct page *new_page(struct page *p, unsigned long private)
14911491
{
14921492
int nid = page_to_nid(p);
14931493

mm/memory_hotplug.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1329,8 +1329,7 @@ static unsigned long scan_movable_pages(unsigned long start, unsigned long end)
13291329
return 0;
13301330
}
13311331

1332-
static struct page *new_node_page(struct page *page, unsigned long private,
1333-
int **result)
1332+
static struct page *new_node_page(struct page *page, unsigned long private)
13341333
{
13351334
int nid = page_to_nid(page);
13361335
nodemask_t nmask = node_states[N_MEMORY];

mm/mempolicy.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,7 @@ static void migrate_page_add(struct page *page, struct list_head *pagelist,
943943
}
944944

945945
/* page allocation callback for NUMA node migration */
946-
struct page *alloc_new_node_page(struct page *page, unsigned long node, int **x)
946+
struct page *alloc_new_node_page(struct page *page, unsigned long node)
947947
{
948948
if (PageHuge(page))
949949
return alloc_huge_page_node(page_hstate(compound_head(page)),
@@ -1108,7 +1108,7 @@ int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from,
11081108
* list of pages handed to migrate_pages()--which is how we get here--
11091109
* is in virtual address order.
11101110
*/
1111-
static struct page *new_page(struct page *page, unsigned long start, int **x)
1111+
static struct page *new_page(struct page *page, unsigned long start)
11121112
{
11131113
struct vm_area_struct *vma;
11141114
unsigned long uninitialized_var(address);
@@ -1153,7 +1153,7 @@ int do_migrate_pages(struct mm_struct *mm, const nodemask_t *from,
11531153
return -ENOSYS;
11541154
}
11551155

1156-
static struct page *new_page(struct page *page, unsigned long start, int **x)
1156+
static struct page *new_page(struct page *page, unsigned long start)
11571157
{
11581158
return NULL;
11591159
}

mm/migrate.c

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,10 +1137,9 @@ static ICE_noinline int unmap_and_move(new_page_t get_new_page,
11371137
enum migrate_reason reason)
11381138
{
11391139
int rc = MIGRATEPAGE_SUCCESS;
1140-
int *result = NULL;
11411140
struct page *newpage;
11421141

1143-
newpage = get_new_page(page, private, &result);
1142+
newpage = get_new_page(page, private);
11441143
if (!newpage)
11451144
return -ENOMEM;
11461145

@@ -1231,12 +1230,6 @@ static ICE_noinline int unmap_and_move(new_page_t get_new_page,
12311230
put_page(newpage);
12321231
}
12331232

1234-
if (result) {
1235-
if (rc)
1236-
*result = rc;
1237-
else
1238-
*result = page_to_nid(newpage);
1239-
}
12401233
return rc;
12411234
}
12421235

@@ -1264,7 +1257,6 @@ static int unmap_and_move_huge_page(new_page_t get_new_page,
12641257
enum migrate_mode mode, int reason)
12651258
{
12661259
int rc = -EAGAIN;
1267-
int *result = NULL;
12681260
int page_was_mapped = 0;
12691261
struct page *new_hpage;
12701262
struct anon_vma *anon_vma = NULL;
@@ -1281,7 +1273,7 @@ static int unmap_and_move_huge_page(new_page_t get_new_page,
12811273
return -ENOSYS;
12821274
}
12831275

1284-
new_hpage = get_new_page(hpage, private, &result);
1276+
new_hpage = get_new_page(hpage, private);
12851277
if (!new_hpage)
12861278
return -ENOMEM;
12871279

@@ -1345,12 +1337,6 @@ static int unmap_and_move_huge_page(new_page_t get_new_page,
13451337
else
13461338
putback_active_hugepage(new_hpage);
13471339

1348-
if (result) {
1349-
if (rc)
1350-
*result = rc;
1351-
else
1352-
*result = page_to_nid(new_hpage);
1353-
}
13541340
return rc;
13551341
}
13561342

@@ -1828,8 +1814,7 @@ static bool migrate_balanced_pgdat(struct pglist_data *pgdat,
18281814
}
18291815

18301816
static struct page *alloc_misplaced_dst_page(struct page *page,
1831-
unsigned long data,
1832-
int **result)
1817+
unsigned long data)
18331818
{
18341819
int nid = (int) data;
18351820
struct page *newpage;

mm/page_isolation.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,7 @@ int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn,
309309
return pfn < end_pfn ? -EBUSY : 0;
310310
}
311311

312-
struct page *alloc_migrate_target(struct page *page, unsigned long private,
313-
int **resultp)
312+
struct page *alloc_migrate_target(struct page *page, unsigned long private)
314313
{
315314
return new_page_nodemask(page, numa_node_id(), &node_states[N_MEMORY]);
316315
}

0 commit comments

Comments
 (0)