Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp3414179img; Mon, 25 Mar 2019 09:47:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqxOFs27szeMVtZVhnK5WRdUDmO5DcRjG3MNZCT+7bN8phHN4OGxjO78Z8BqQVkDmSboSYNX X-Received: by 2002:a63:5622:: with SMTP id k34mr24235362pgb.123.1553532461827; Mon, 25 Mar 2019 09:47:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553532461; cv=none; d=google.com; s=arc-20160816; b=nHRLUS2ZW8H5zRd6OgthtLLwoPnZGcsLtWmujiiSYNbLjVtkQ9OBUZEP0wMWBg9vq/ AaVef0S3ujL3dYgZT2GWocGb0/G6tIhpsGioO7Zo77b6jhryG6wzaBhSFMexDUwn6csU FwETRYVsvjlq3+SXMW7xuISIGlpusVWb7VN4laWqYWsos6cHBwnEWPRKVKUlXPlqf9O3 bG3H84tx/rPJJ/Yf/sDI5w843Q3o7D1iNTVgwUSn2mLYbgzAgVIay80YoFvfOn6YhlDj fkUFh2wS0o0HkBgvby/CQdgYPzHJ+ezy0PIfJ6i0mvsDuUVZ3KB3xpInSzVzn6k1Ix3Z U/iQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=azszLIWADnCz8AeAgm8+58HpL8DqZnCAWctdIVFE5Zo=; b=LAdyeAUzeP4Jd4W66JPgR2M+5GhAMznGQEjOzcQ3VAl5ox/5GpyzEilscglJUxoomV cJ/N/iN13XuyLPluTLbRR3HG4lI3iQUs7RvmiQLfVa0L0qKoNeID+uJ2TNqiMQpwFyi3 ELQmuBM6QyfcMG1AgzxtA7dUHAHVr2SKZ7WOPdeV3I0zExQKkf1JnTKueQwwj0o8+bZi uKCVMaf0KimZEFGHVWm91eP6YRSpos2KRdygzhD9bSTXVeheskRsYDv3yTjFjknrRZkz Je+p+EEnMrLb6/fiy4WCQ3EpxI2yrfEtbbRu0+8TCuUxI98wGPQJgWnJ60EjTJdKVCa+ 86Kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=ZDbQf6wF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i38si14976851plb.194.2019.03.25.09.47.26; Mon, 25 Mar 2019 09:47:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=ZDbQf6wF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729911AbfCYQpZ (ORCPT + 99 others); Mon, 25 Mar 2019 12:45:25 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:39833 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729204AbfCYQpY (ORCPT ); Mon, 25 Mar 2019 12:45:24 -0400 Received: by mail-qt1-f194.google.com with SMTP id t28so11081445qte.6 for ; Mon, 25 Mar 2019 09:45:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=azszLIWADnCz8AeAgm8+58HpL8DqZnCAWctdIVFE5Zo=; b=ZDbQf6wFJU+EYUfgK208d7q5xgEAsedfDWsH7HcS+TgxZe1Tssa2BPdsAG2/hwMAys rsvWpbV2F4p94YwmKTFIuX4ZYCNds18YVeb5XKR3N/q/IwU3EkNwJcTVzYn6EDh7fZln 2OZxPHIHWfFGj7YZXdyCqHS05W2dh7149lXSg4/ukEQUMHL7D7Y6NtaabG2aYj9KasxM PHuOzwzg4iM4288xlpCX0Y7+myHdwiQDA5aQ9iytY8LSSCnI+uBbm/mNp75vQ71uvTOh 1u0QcVedoEpv2k/lmslIikFO/JBL2Dw9XFQLEa1MLkr1UZsADEa008jT8NGlhOraW5UW A0zQ== 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; bh=azszLIWADnCz8AeAgm8+58HpL8DqZnCAWctdIVFE5Zo=; b=RZCHGy8/So04prvzNKwrg2uM0q14jNIxPN4zfTSOl0kO3leKRdDvwS+4vZiDoAHE2i St62pu2/6SNYNoa9fRaariWYOOmtjpagcblG1lv31weVeJpsNAQ5pjqDaPCOunNjmsw1 aHDg16xry3V17p9lEZkJ3w9cv6SpAtSANep4fbd4nNaKWTBY8HJ76AaA1jN16ShqCerV FtCUuqi9I0ynWJ7QhBTWotFwGTMwUYT0n6BQdSsoe/EfBQ6X2UTLgv+fWNYepBumw5e/ PN/E/kPQbU25b7lfNYR1tKVRf0BYRJxxuSnmcYPFkxBwFaYevBWjoHAkOu1FbpQJA6bn YVzg== X-Gm-Message-State: APjAAAWE6txDADmqNK2k9GUV8UYMq2cDP9gzwH3JrREQVvX/2hVsQlyd 2zv4YzFCIpPNYk/eTI92L3vIcbDhkd/RPD2Op3cmGA== X-Received: by 2002:ac8:2396:: with SMTP id q22mr22096706qtq.382.1553532323693; Mon, 25 Mar 2019 09:45:23 -0700 (PDT) MIME-Version: 1.0 References: <20190317183438.2057-1-ira.weiny@intel.com> <20190317183438.2057-2-ira.weiny@intel.com> <20190325061941.GA16366@iweiny-DESK2.sc.intel.com> In-Reply-To: <20190325061941.GA16366@iweiny-DESK2.sc.intel.com> From: Dan Williams Date: Mon, 25 Mar 2019 09:45:12 -0700 Message-ID: Subject: Re: [RESEND 1/7] mm/gup: Replace get_user_pages_longterm() with FOLL_LONGTERM To: Ira Weiny Cc: Andrew Morton , John Hubbard , Michal Hocko , "Kirill A. Shutemov" , Peter Zijlstra , Jason Gunthorpe , Benjamin Herrenschmidt , Paul Mackerras , "David S. Miller" , Martin Schwidefsky , Heiko Carstens , Rich Felker , Yoshinori Sato , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Ralf Baechle , James Hogan , "Aneesh Kumar K . V" , Michal Hocko , linux-mm , Linux Kernel Mailing List , linux-mips@vger.kernel.org, linuxppc-dev , linux-s390 , Linux-sh , sparclinux@vger.kernel.org, linux-rdma , "netdev@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 25, 2019 at 7:21 AM Ira Weiny wrote: [..] > > > @@ -1268,10 +1246,14 @@ static long check_and_migrate_cma_pages(unsigned long start, long nr_pages, > > > putback_movable_pages(&cma_page_list); > > > } > > > /* > > > - * We did migrate all the pages, Try to get the page references again > > > - * migrating any new CMA pages which we failed to isolate earlier. > > > + * We did migrate all the pages, Try to get the page references > > > + * again migrating any new CMA pages which we failed to isolate > > > + * earlier. > > > */ > > > - nr_pages = get_user_pages(start, nr_pages, gup_flags, pages, vmas); > > > + nr_pages = __get_user_pages_locked(tsk, mm, start, nr_pages, > > > + pages, vmas, NULL, > > > + gup_flags); > > > + > > > > Why did this need to change to __get_user_pages_locked? > > __get_uer_pages_locked() is now the "internal call" for get_user_pages. > > Technically it did not _have_ to change but there is no need to call > get_user_pages() again because the FOLL_TOUCH flags is already set. Also this > call then matches the __get_user_pages_locked() which was called on the pages > we migrated from. Mostly this keeps the code "symmetrical" in that we called > __get_user_pages_locked() on the pages we are migrating from and the same call > on the pages we migrated to. > > While the change here looks funny I think the final code is better. Agree, but I think that either needs to be noted in the changelog so it's not a surprise, or moved to a follow-on cleanup patch.