lkml.org 
[lkml]   [2020]   [Jul]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v3 6/8] mm/gup: use a standard migration target allocation callback
From
Date
On 6/23/20 8:13 AM, js1304@gmail.com wrote:
> From: Joonsoo Kim <iamjoonsoo.kim@lge.com>
>
> There is a well-defined migration target allocation callback.
> It's mostly similar with new_non_cma_page() except considering CMA pages.
>
> This patch adds a CMA consideration to the standard migration target
> allocation callback and use it on gup.c.
>
> Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>

Acked-by: Vlastimil Babka <vbabka@suse.cz>

But a suggestion below.

> ---
> mm/gup.c | 57 ++++++++-------------------------------------------------
> mm/internal.h | 1 +
> mm/migrate.c | 4 +++-
> 3 files changed, 12 insertions(+), 50 deletions(-)
>
> diff --git a/mm/gup.c b/mm/gup.c
> index 15be281..f6124e3 100644
> --- a/mm/gup.c
> +++ b/mm/gup.c
> @@ -1608,56 +1608,15 @@ static bool check_dax_vmas(struct vm_area_struct **vmas, long nr_pages)
> }
>
> #ifdef CONFIG_CMA
> -static struct page *new_non_cma_page(struct page *page, unsigned long private)
> +static struct page *alloc_migration_target_non_cma(struct page *page, unsigned long private)
> {

...

> + struct migration_target_control mtc = {
> + .nid = page_to_nid(page),
> + .gfp_mask = GFP_USER | __GFP_NOWARN,
> + .skip_cma = true,
> + };
>
> - return __alloc_pages_node(nid, gfp_mask, 0);
> + return alloc_migration_target(page, (unsigned long)&mtc);

Do we really need this wrapper? The only user is check_and_migrate_cma_pages so
just opencode it?

\
 
 \ /
  Last update: 2020-07-03 17:57    [W:0.388 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site