]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mm/page_alloc: remove a wrapper for alloc_migration_target()
authorJoonsoo Kim <iamjoonsoo.kim@lge.com>
Wed, 12 Aug 2020 01:37:31 +0000 (18:37 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 12 Aug 2020 17:58:02 +0000 (10:58 -0700)
There is a well-defined standard migration target callback.  Use it
directly.

Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Michal Hocko <mhocko@suse.com>
Acked-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Christoph Hellwig <hch@infradead.org>
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-8-git-send-email-iamjoonsoo.kim@lge.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/page_alloc.c
mm/page_isolation.c

index d80c9bac489cf9e5a9adf2f67fa88e2fb10a3c41..8b7d0ecf30b1c3c876aea7ada40c999772b1a6f7 100644 (file)
@@ -8347,6 +8347,10 @@ static int __alloc_contig_migrate_range(struct compact_control *cc,
        unsigned long pfn = start;
        unsigned int tries = 0;
        int ret = 0;
+       struct migration_target_control mtc = {
+               .nid = zone_to_nid(cc->zone),
+               .gfp_mask = GFP_USER | __GFP_MOVABLE | __GFP_RETRY_MAYFAIL,
+       };
 
        migrate_prep();
 
@@ -8373,8 +8377,8 @@ static int __alloc_contig_migrate_range(struct compact_control *cc,
                                                        &cc->migratepages);
                cc->nr_migratepages -= nr_reclaimed;
 
-               ret = migrate_pages(&cc->migratepages, alloc_migrate_target,
-                                   NULL, 0, cc->mode, MR_CONTIG_RANGE);
+               ret = migrate_pages(&cc->migratepages, alloc_migration_target,
+                               NULL, (unsigned long)&mtc, cc->mode, MR_CONTIG_RANGE);
        }
        if (ret < 0) {
                putback_movable_pages(&cc->migratepages);
index f25c66ea37acddb438ca812b4ba25362a71a8556..242c03121d7317b26c88a030bd42d783ac844ab3 100644 (file)
@@ -306,13 +306,3 @@ int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn,
 
        return pfn < end_pfn ? -EBUSY : 0;
 }
-
-struct page *alloc_migrate_target(struct page *page, unsigned long private)
-{
-       struct migration_target_control mtc = {
-               .nid = page_to_nid(page),
-               .gfp_mask = GFP_USER | __GFP_MOVABLE | __GFP_RETRY_MAYFAIL,
-       };
-
-       return alloc_migration_target(page, (unsigned long)&mtc);
-}