From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0FE7C433DF for ; Mon, 6 Jul 2020 08:34:44 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 727792073E for ; Mon, 6 Jul 2020 08:34:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DIf6Nsqe" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 727792073E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id F1F2D6B0008; Mon, 6 Jul 2020 04:34:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ECF266B000A; Mon, 6 Jul 2020 04:34:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DBE296B000E; Mon, 6 Jul 2020 04:34:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0226.hostedemail.com [216.40.44.226]) by kanga.kvack.org (Postfix) with ESMTP id C74706B0008 for ; Mon, 6 Jul 2020 04:34:43 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 88B7C1EE6 for ; Mon, 6 Jul 2020 08:34:43 +0000 (UTC) X-FDA: 77006990046.10.way77_230e59026eaa Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin10.hostedemail.com (Postfix) with ESMTP id ECA5F16A0DE for ; Mon, 6 Jul 2020 08:34:36 +0000 (UTC) X-HE-Tag: way77_230e59026eaa X-Filterd-Recvd-Size: 5206 Received: from mail-qv1-f65.google.com (mail-qv1-f65.google.com [209.85.219.65]) by imf39.hostedemail.com (Postfix) with ESMTP for ; Mon, 6 Jul 2020 08:34:36 +0000 (UTC) Received: by mail-qv1-f65.google.com with SMTP id dm12so16811860qvb.9 for ; Mon, 06 Jul 2020 01:34:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=UkKwMcyV/GIfNduaGOpb0yO+n875IEZ+a5vFi7DoFpk=; b=DIf6NsqeHVipKmVGsTJqd0GUJh0l+C6ZQxY2ih+ict7nQ1yoDCOZ9fNe8A4UoyjpaM uDH1M1E6zSsDUgV/bOeuHpDnRu2+vdPJIcKI2atc0fIcSgzXgW2MNZaIhA1jrOtb+s1F hath9V1gbPmd/NeroyZBPcDq2X+ZAfs0UvN5Tz7y6WdFqIftTifpOJdWixbpIgeyHsgk mosNhaIyCEIHAK4Z5QYQp99hforMNcMTDO8UevE/n9XK+hrZ8l6Ce6oz4acoMmvXRvhf +YikJlULjh7ZHAzmZ0S3Ad8td4BocD1NYEux4809TroeBRQh0ht/gWDTvb2/eEiJxzlR nVHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=UkKwMcyV/GIfNduaGOpb0yO+n875IEZ+a5vFi7DoFpk=; b=Jmv+BWoB9zfLj1uJE/0KCuJ9BixGj5m840pTGHIwm+hrIGv458BCD5BuWkc2j6trn7 /1iMTwLVnndDdJ+/K7Gg4Yzp5vw89BsLT4kuEuIxidwA5ufrMA1BBbkfKM33x9SM20qs suBvmzXjW2UG3cOnyhdW19EBXBZfxcg1CCjgwE6/ZipqYEyljukzAKXQ6WF2PZ6AAn8v EMJNfiBqAXuiaa2/G8lpYB/Yvq6UzBAYNNj3wll9GEiko1AE76WxM7AcB+xAidOjFOln z4RYbKQf561rXghteqi07gxRisrSDZiWQB3ZdwBKBDx7ZUgzaNuEfR8hJ7I2tad0YBBF VVrA== X-Gm-Message-State: AOAM532f7BCHrS/mkqOXbRj9nOitWhfzRdH/AjKY0/2nyfvuj25YvgZK 8e8SBok3Vtm0Mh4Mq/0Ue845vhHccNLe9oRYxgA= X-Google-Smtp-Source: ABdhPJzvQ/UEjQJLymsEW6+9+VbkS0haV5RioJL/PYBX+QMXInUlAPbwpJdA/73/RaZLynG/7h/cWMq7+zWksj+uAhw= X-Received: by 2002:a0c:99c5:: with SMTP id y5mr22989544qve.66.1594024475887; Mon, 06 Jul 2020 01:34:35 -0700 (PDT) MIME-Version: 1.0 References: <1592892828-1934-1-git-send-email-iamjoonsoo.kim@lge.com> <1592892828-1934-7-git-send-email-iamjoonsoo.kim@lge.com> <1693d7a8-4384-8fd8-69a2-55552329a34d@suse.cz> In-Reply-To: <1693d7a8-4384-8fd8-69a2-55552329a34d@suse.cz> From: Joonsoo Kim Date: Mon, 6 Jul 2020 17:34:24 +0900 Message-ID: Subject: Re: [PATCH v3 6/8] mm/gup: use a standard migration target allocation callback To: Vlastimil Babka Cc: Andrew Morton , Linux Memory Management List , LKML , kernel-team@lge.com, Christoph Hellwig , Roman Gushchin , Mike Kravetz , Naoya Horiguchi , Michal Hocko , Joonsoo Kim Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: ECA5F16A0DE X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 2020=EB=85=84 7=EC=9B=94 4=EC=9D=BC (=ED=86=A0) =EC=98=A4=EC=A0=84 12:56, V= lastimil Babka =EB=8B=98=EC=9D=B4 =EC=9E=91=EC=84=B1: > > 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 page= s. > > > > 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_struc= t **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 =3D { > > + .nid =3D page_to_nid(page), > > + .gfp_mask =3D GFP_USER | __GFP_NOWARN, > > + .skip_cma =3D 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_pa= ges so > just opencode it? This wrapper exists for setting up a different nid for each page. However, as you suggested in the next reply, we can remove this wrapper if NUMA_NO_NODE handling is added to the standard function. I will add NUMA_NO= _NODE handling to the standard function and remove this wrapper. Thanks.