Skip to content

Commit 8b94e0b

Browse files
JoonsooKimtorvalds
authored andcommitted
mm/page_alloc: remove a wrapper for alloc_migration_target()
There is a well-defined standard migration target callback. Use it directly. Signed-off-by: Joonsoo Kim <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Acked-by: Michal Hocko <[email protected]> Acked-by: Vlastimil Babka <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Mike Kravetz <[email protected]> Cc: Naoya Horiguchi <[email protected]> Cc: Roman Gushchin <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
1 parent a097631 commit 8b94e0b

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

mm/page_alloc.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8347,6 +8347,10 @@ static int __alloc_contig_migrate_range(struct compact_control *cc,
83478347
unsigned long pfn = start;
83488348
unsigned int tries = 0;
83498349
int ret = 0;
8350+
struct migration_target_control mtc = {
8351+
.nid = zone_to_nid(cc->zone),
8352+
.gfp_mask = GFP_USER | __GFP_MOVABLE | __GFP_RETRY_MAYFAIL,
8353+
};
83508354

83518355
migrate_prep();
83528356

@@ -8373,8 +8377,8 @@ static int __alloc_contig_migrate_range(struct compact_control *cc,
83738377
&cc->migratepages);
83748378
cc->nr_migratepages -= nr_reclaimed;
83758379

8376-
ret = migrate_pages(&cc->migratepages, alloc_migrate_target,
8377-
NULL, 0, cc->mode, MR_CONTIG_RANGE);
8380+
ret = migrate_pages(&cc->migratepages, alloc_migration_target,
8381+
NULL, (unsigned long)&mtc, cc->mode, MR_CONTIG_RANGE);
83788382
}
83798383
if (ret < 0) {
83808384
putback_movable_pages(&cc->migratepages);

mm/page_isolation.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -306,13 +306,3 @@ int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn,
306306

307307
return pfn < end_pfn ? -EBUSY : 0;
308308
}
309-
310-
struct page *alloc_migrate_target(struct page *page, unsigned long private)
311-
{
312-
struct migration_target_control mtc = {
313-
.nid = page_to_nid(page),
314-
.gfp_mask = GFP_USER | __GFP_MOVABLE | __GFP_RETRY_MAYFAIL,
315-
};
316-
317-
return alloc_migration_target(page, (unsigned long)&mtc);
318-
}

0 commit comments

Comments
 (0)