From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 25 Mar 2019 01:46:14 -0700 From: Ira Weiny 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: Sender: linux-mips-owner@vger.kernel.org List-Archive: List-Post: 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" List-ID: 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