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=-8.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,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 8221FCA9EAF for ; Thu, 24 Oct 2019 17:40:29 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 41F2320650 for ; Thu, 24 Oct 2019 17:40:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="anHytsPE" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 41F2320650 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id CBF096B0003; Thu, 24 Oct 2019 13:40:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C6EDD6B0006; Thu, 24 Oct 2019 13:40:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B5E7A6B0007; Thu, 24 Oct 2019 13:40:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0004.hostedemail.com [216.40.44.4]) by kanga.kvack.org (Postfix) with ESMTP id 94BA06B0003 for ; Thu, 24 Oct 2019 13:40:28 -0400 (EDT) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 491CD824999B for ; Thu, 24 Oct 2019 17:40:28 +0000 (UTC) X-FDA: 76079392536.01.crack91_78481ed28b143 X-HE-Tag: crack91_78481ed28b143 X-Filterd-Recvd-Size: 4359 Received: from hqemgate16.nvidia.com (hqemgate16.nvidia.com [216.228.121.65]) by imf49.hostedemail.com (Postfix) with ESMTP for ; Thu, 24 Oct 2019 17:40:26 +0000 (UTC) Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Thu, 24 Oct 2019 10:40:29 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Thu, 24 Oct 2019 10:40:25 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Thu, 24 Oct 2019 10:40:25 -0700 Received: from DRHQMAIL107.nvidia.com (10.27.9.16) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 24 Oct 2019 17:40:24 +0000 Received: from [10.110.48.28] (10.124.1.5) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 24 Oct 2019 17:40:24 +0000 Subject: Re: [PATCH v2] mm: gup: fix comment of __get_user_pages() To: Liu Xiang , CC: References: <1571929472-3091-1-git-send-email-liuxiang_1999@126.com> X-Nvconfidentiality: public From: John Hubbard Message-ID: <91d727c8-d2d3-8498-d3ff-8032da9a055d@nvidia.com> Date: Thu, 24 Oct 2019 10:40:24 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <1571929472-3091-1-git-send-email-liuxiang_1999@126.com> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To DRHQMAIL107.nvidia.com (10.27.9.16) Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1571938829; bh=n7We2NgiNuh1YUglpKmrd+msDu/DGyBImzj+mPZ4P8A=; h=X-PGP-Universal:Subject:To:CC:References:X-Nvconfidentiality:From: Message-ID:Date:User-Agent:MIME-Version:In-Reply-To: X-Originating-IP:X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=anHytsPEY3EL2wS/3U/3lK9AYPqWUJqjQi5HFB1jA4FMRKp4/suPKiIJL6u0HnhlG Kr1L+nA2XiRPJRF6r7OLLvgxgS0DTr03CNKyvqgkJI5ZQxmZ75Wlnq5xA/+hVXeJ/d KEZ2nJopfe6SUsPt7ssx69XrRM5OJ2qtN17jOMLdw0kz9TiqfvQ4kNR/fVZ9Zi8gdT xqnKCGXksCa+Ugh75yi4mke/BfWoj7HSRo3buus09sFuTdbLKEbLqDNJjNQUdhkjBo 97F4olg7tVtoHPCG9784gzZGpdSFhAmT3Q3UAPcOZLdHR6Nxwo8OZTPpevrWzhmptw ea7UkKY7eLotw== 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: On 10/24/19 8:04 AM, Liu Xiang wrote: > Fix comment of __get_user_pages() and make it more clear. > > Suggested-by: John Hubbard > Signed-off-by: Liu Xiang > --- > > Changes in v2: > as suggested by John, rewrite the comment about return value. > > mm/gup.c | 16 +++++++++++----- > 1 file changed, 11 insertions(+), 5 deletions(-) > Reviewed-by: John Hubbard thanks, -- John Hubbard NVIDIA > diff --git a/mm/gup.c b/mm/gup.c > index 8f236a3..bc6a254 100644 > --- a/mm/gup.c > +++ b/mm/gup.c > @@ -734,11 +734,17 @@ static int check_vma_flags(struct vm_area_struct *vma, unsigned long gup_flags) > * Or NULL if the caller does not require them. > * @nonblocking: whether waiting for disk IO or mmap_sem contention > * > - * Returns number of pages pinned. This may be fewer than the number > - * requested. If nr_pages is 0 or negative, returns 0. If no pages > - * were pinned, returns -errno. Each page returned must be released > - * with a put_page() call when it is finished with. vmas will only > - * remain valid while mmap_sem is held. > + * Returns either number of pages pinned (which may be less than the > + * number requested), or an error. Details about the return value: > + * > + * -- If nr_pages is 0, returns 0. > + * -- If nr_pages is >0, but no pages were pinned, returns -errno. > + * -- If nr_pages is >0, and some pages were pinned, returns the number of > + * pages pinned. Again, this may be less than nr_pages. > + * > + * The caller is responsible for releasing returned @pages, via put_page(). > + * > + * @vmas are valid only as long as mmap_sem is held. > * > * Must be called with mmap_sem held. It may be released. See below. > * >