Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2432646ybt; Fri, 3 Jul 2020 08:57:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJygpZoDKxOQFoMjzWIwLDnR+7K0GE9j/WRNE74HUDT+RoLDMGh/q+wohBrH/gJRLa6h5UYa X-Received: by 2002:a50:ed15:: with SMTP id j21mr14910357eds.246.1593791848172; Fri, 03 Jul 2020 08:57:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593791848; cv=none; d=google.com; s=arc-20160816; b=B++AvQB1jye0i8dIaONq8pTLp+dXOL4rOJqwHzs7hYCGT4boy18+nlXr0Sg+ZNzhS0 stf7xnzwKPqBmKuK96oTVxMsCf2DSFXpiC8Iicz+pgO7gd8bPK74fomiQ+ktOnX4Dzkl S5UGrB7Snwzst05xbZVzwE40HqdmRWn8kvYulfZlvDZ8AIhrumsh4wT+OzdQsbE/IWxg bgf0jswE6KwXqBDEYAp06g9TtSauYR+/y+YvVfaQT7hmvi5Bkyna/UjJfnsk294tUvZp HtpVQoaLBDfE1kQ/GGLXscVq1oWkHpbpu51vkf2MgQHDKMlNKx0iDnPIHxG7MGy3mafg UBVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=fLlEQfMeWbhCmKDxlS3Iym41WIQOkpTuKz7Q3L3zjZU=; b=exKRhGj+q2Chke5T7lh/GFIQ1uQCQzGYwWv1vRad17mWG39f5FlgDY2G1Sb4SODQHR kagvcsz3yrubqaHVSHtzAMKdGe7aHi+KXnbsN0+CRDAh9pUO4ZkDGtJ6uC5v874LE7Co tKXrfUJPaqONgmfDqgjK9z8omgn8rUusmUx7zcBnFBvAiJDCNTPPrvupETi6uHFvqrkp wNHU5r1b3f11k3burhmnmmz7wCOnux+djJ2+t3Q/Pmi8nLUVLN5ca87fe0wTv0uRA9tj rKhV/KVA8DPym8S8Q8xVEPKcrDTC7Hdgr3XngURgADDhLasZMp6isvuAhYs7LmETJaVu w0XQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n7si8049633ejk.154.2020.07.03.08.57.04; Fri, 03 Jul 2020 08:57:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726304AbgGCP4e (ORCPT + 99 others); Fri, 3 Jul 2020 11:56:34 -0400 Received: from mx2.suse.de ([195.135.220.15]:57216 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726035AbgGCP4e (ORCPT ); Fri, 3 Jul 2020 11:56:34 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 65440AD79; Fri, 3 Jul 2020 15:56:33 +0000 (UTC) Subject: Re: [PATCH v3 6/8] mm/gup: use a standard migration target allocation callback To: js1304@gmail.com, Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@lge.com, Christoph Hellwig , Roman Gushchin , Mike Kravetz , Naoya Horiguchi , Michal Hocko , Joonsoo Kim References: <1592892828-1934-1-git-send-email-iamjoonsoo.kim@lge.com> <1592892828-1934-7-git-send-email-iamjoonsoo.kim@lge.com> From: Vlastimil Babka Message-ID: <1693d7a8-4384-8fd8-69a2-55552329a34d@suse.cz> Date: Fri, 3 Jul 2020 17:56:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <1592892828-1934-7-git-send-email-iamjoonsoo.kim@lge.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/23/20 8:13 AM, js1304@gmail.com wrote: > From: Joonsoo Kim > > 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 Acked-by: Vlastimil Babka 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?