Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp3414662img; Mon, 25 Mar 2019 09:48:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqwhsN7RmFzKFHPkKF4KPyF2q/6PNKeFVtI/0jmZjZutH6+rIkBfdJMWEQR/ZXeNqgDAIVHg X-Received: by 2002:a63:cc03:: with SMTP id x3mr23926359pgf.121.1553532501689; Mon, 25 Mar 2019 09:48:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553532501; cv=none; d=google.com; s=arc-20160816; b=QCwXBZjAv2tv2fX5Vlhs20lZ0n00QdPz6c5j0xS2Hz0aNI8R2sBSVNPquYBom8DN6k g8lbNNxSPVPvMiyrpCLwMkd7Ti5EnvENQcgXOWyMNBsizRa49BkVHSkbzajw872FAaSs 04zp+PrDFEdO3W4qDDjBriC8jNOU8jtOfEot5kymeZZTFehanwk5lQkaFJcGw5EXZdoq 2H7k0hKmvHFvbKSo8N21Q+SWvVieLXviEh65n0kSi/D2eYZBJywDuPTiaLgFqXERiJd4 2/aHl6ZjjH/iJvL6hm0feYZkZaOJ0kxvZq+3dpVCGwhrmj21Pvf/ahFemx1ug2FI7iIm gpnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=vMm1SwFwexRmfe0DhLS1tSZeKphD9ShP6utr7v396Xo=; b=ELeMFPPwXTv/1OL9fRX1BXzB74tRqa0WWRo/gK6GXVulOY3YSb3rrqtp7uDn4I1ifj CvvLPQJjeECyLe/Hn53xtlE4wSq7mkbhy6DkMOLwVJIlR4Urq8bJXJTx9YICpcjAOmKZ A16UnDOvjmbhqAW20FU1Yjb6/4nGKIV6vy2cHWckHNS0Zr24FaZP/z0xqn+VIhUxTbGT S7nfIbT3gVSZVFCtOO6NTFYhkE3qHN9E6JPXomtWXUkKu2iOk6q/JJN9xyXotE2OqhKF ui4BFqh4pHF9INmg+RbN23ZXg19AHpO4QRvG0DHxD1cdgQQqu4SCLJgJToAQ/15ZJcnH Ye8w== ARC-Authentication-Results: i=1; mx.google.com; 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 x2si2915601pgh.231.2019.03.25.09.48.06; Mon, 25 Mar 2019 09:48:21 -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; 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 S1729889AbfCYQr3 (ORCPT + 99 others); Mon, 25 Mar 2019 12:47:29 -0400 Received: from mga07.intel.com ([134.134.136.100]:64909 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725795AbfCYQr2 (ORCPT ); Mon, 25 Mar 2019 12:47:28 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Mar 2019 09:47:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,269,1549958400"; d="scan'208";a="145091052" Received: from iweiny-desk2.sc.intel.com ([10.3.52.157]) by orsmga002.jf.intel.com with ESMTP; 25 Mar 2019 09:47:25 -0700 Date: Mon, 25 Mar 2019 01:46:14 -0700 From: Ira Weiny To: Dan Williams 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" Subject: Re: [RESEND 1/7] mm/gup: Replace get_user_pages_longterm() with FOLL_LONGTERM Message-ID: <20190325084614.GE16366@iweiny-DESK2.sc.intel.com> References: <20190317183438.2057-1-ira.weiny@intel.com> <20190317183438.2057-2-ira.weiny@intel.com> <20190325061941.GA16366@iweiny-DESK2.sc.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.1 (2018-12-01) 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 09:45:12AM -0700, Dan Williams wrote: > 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. > Can do... Thanks! Ira