lkml.org 
[lkml]   [2020]   [May]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 11/11] mm/page_alloc: use standard migration target allocation function directly
    Date
    From: Joonsoo Kim <iamjoonsoo.kim@lge.com>

    There is no need to make a function in order to call standard migration
    target allocation function. Use standard one directly.

    Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
    ---
    include/linux/page-isolation.h | 2 --
    mm/page_alloc.c | 9 +++++++--
    mm/page_isolation.c | 11 -----------
    3 files changed, 7 insertions(+), 15 deletions(-)

    diff --git a/include/linux/page-isolation.h b/include/linux/page-isolation.h
    index 35e3bdb..20a4b63 100644
    --- a/include/linux/page-isolation.h
    +++ b/include/linux/page-isolation.h
    @@ -62,6 +62,4 @@ undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
    int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn,
    int isol_flags);

    -struct page *alloc_migrate_target(struct page *page, struct alloc_control *ac);
    -
    #endif
    diff --git a/mm/page_alloc.c b/mm/page_alloc.c
    index afdd0fb..2a7ab2b 100644
    --- a/mm/page_alloc.c
    +++ b/mm/page_alloc.c
    @@ -8288,6 +8288,11 @@ static int __alloc_contig_migrate_range(struct compact_control *cc,
    unsigned long pfn = start;
    unsigned int tries = 0;
    int ret = 0;
    + struct alloc_control ac = {
    + .nid = zone_to_nid(cc->zone),
    + .nmask = &node_states[N_MEMORY],
    + .gfp_mask = GFP_USER | __GFP_MOVABLE | __GFP_RETRY_MAYFAIL,
    + };

    migrate_prep();

    @@ -8314,8 +8319,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, NULL, cc->mode, MR_CONTIG_RANGE);
    + ret = migrate_pages(&cc->migratepages, alloc_migration_target,
    + NULL, &ac, cc->mode, MR_CONTIG_RANGE);
    }
    if (ret < 0) {
    putback_movable_pages(&cc->migratepages);
    diff --git a/mm/page_isolation.c b/mm/page_isolation.c
    index aba799d..03d6cad 100644
    --- a/mm/page_isolation.c
    +++ b/mm/page_isolation.c
    @@ -297,14 +297,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, struct alloc_control *__ac)
    -{
    - struct alloc_control ac = {
    - .nid = page_to_nid(page),
    - .nmask = &node_states[N_MEMORY],
    - .gfp_mask = GFP_USER | __GFP_MOVABLE | __GFP_RETRY_MAYFAIL,
    - };
    -
    - return alloc_migration_target(page, &ac);
    -}
    --
    2.7.4
    \
     
     \ /
      Last update: 2020-05-18 03:23    [W:6.472 / U:0.084 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site