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=-9.9 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, NULL_IN_BODY,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 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 C72D3C433DF for ; Sun, 16 Aug 2020 02:05:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9C9F820716 for ; Sun, 16 Aug 2020 02:05:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729890AbgHPCFP convert rfc822-to-8bit (ORCPT ); Sat, 15 Aug 2020 22:05:15 -0400 Received: from hqnvemgate24.nvidia.com ([216.228.121.143]:4140 "EHLO hqnvemgate24.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727824AbgHPCFP (ORCPT ); Sat, 15 Aug 2020 22:05:15 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Sat, 15 Aug 2020 19:03:23 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Sat, 15 Aug 2020 19:05:13 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Sat, 15 Aug 2020 19:05:13 -0700 Received: from [10.2.60.198] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Sun, 16 Aug 2020 02:05:05 +0000 Subject: Re: [PATCH] mm/gup_benchmark: use pin_user_pages for FOLL_LONGTERM flag To: Barry Song , , , , CC: , Jan Kara , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , "Matthew Wilcox (Oracle)" , Al Viro , "Christoph Hellwig" , Dan Williams , "Dave Chinner" , Jason Gunthorpe , "Jonathan Corbet" , Michal Hocko , Mike Kravetz , Shuah Khan , Vlastimil Babka References: <20200815122056.29508-1-song.bao.hua@hisilicon.com> From: John Hubbard Message-ID: Date: Sat, 15 Aug 2020 19:05:05 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200815122056.29508-1-song.bao.hua@hisilicon.com> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/15/20 5:20 AM, Barry Song wrote: > According to Documentation/core-api/pin_user_pages.rst, FOLL_PIN is a > prerequisite to FOLL_LONGTERM. Another way of saying that is, > FOLL_LONGTERM is a specific case, more restrictive case of FOLL_PIN. > > Almost all kernel modules are using pin_user_pages() with FOLL_LONGTERM, > mm/gup_benchmark.c seems to the only exception in which FOLL_PIN is not > a prerequisite to FOLL_LONGTERM. > > Cc: John Hubbard > Cc: Jan Kara > Cc: Jérôme Glisse > Cc: "Matthew Wilcox (Oracle)" > Cc: Al Viro > Cc: Christoph Hellwig > Cc: Dan Williams > Cc: Dave Chinner > Cc: Jason Gunthorpe > Cc: Jonathan Corbet > Cc: Michal Hocko > Cc: Mike Kravetz > Cc: Shuah Khan > Cc: Vlastimil Babka > Signed-off-by: Barry Song > --- > mm/gup_benchmark.c | 23 +++++++++++----------- > tools/testing/selftests/vm/gup_benchmark.c | 14 ++++++------- > 2 files changed, 19 insertions(+), 18 deletions(-) DKIM-Signature: v a