Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp3992159ybg; Fri, 25 Oct 2019 11:47:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqzttUjK8UqVp6DTwH5WJQMyXkGxA1Q5L9If0PCkrvhw3hHulmlLA81RYq+l46+apRANFkGu X-Received: by 2002:a17:907:2139:: with SMTP id qo25mr4931640ejb.207.1572029256266; Fri, 25 Oct 2019 11:47:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572029256; cv=none; d=google.com; s=arc-20160816; b=H525KCt4Wf0x/o+VwktOZf3pzlBhPp5FODj1GMICBhtSAYI2e/sVim7oYSgREOiDp9 4NuJRsYWYChrICRcOZjrsV+78YFTHlNqY870yZHmhfl/RAUiJC/lRVxa0hBZbGnLkeLy dyAwRiVPkQTkdxT7z4VFWxpYzouiTMASzZBlEuVLManOVveebu349+qIUR7cLMqzxcMd wVQDgrPSjWdxiy9PKG0iPNRDZCCSp33GSyKnJMwodxcOt/QjEcVOntPAr0dzYVjDuysP naFDvvaeOm74HbKKnBz6VVywN+uMY0Saow6oGjaPaoNZpb1uCcMmnpTfvfdIgtwf92ux E5MQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=n7We2NgiNuh1YUglpKmrd+msDu/DGyBImzj+mPZ4P8A=; b=QwfpBl54qo/KWkA/DX64js8eY39zAi5UHfyjvuZzn/X77AJDTVSAZuWc60qTwmfdf4 lW18AUQEqLBsw3QiZ/HXpu0pUtgYYrmPOH5m445AROOEraaXIgisTcqrCjOF0HNkdjnG murTebwbRuwlsXytd44CQb5dIPKw6968CeEz73w6XnDD85e0w6pTBYnygulfji3UIZ8V 3acI5M2QFdYeuW3Zb/Hhdkkoc57gtQ1vei8wPrqGLegP08Vw12ayNxezYjIW9SxCRLAn +rthUVqkWoK18nIG8hlGxF8UDRA2qHip0QVxMVK65Sg7YMZMuL/yc+jdxvlDTgyn28KO 9sLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=anHytsPE; 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=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cw1si1761125ejb.117.2019.10.25.11.47.13; Fri, 25 Oct 2019 11:47:36 -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=@nvidia.com header.s=n1 header.b=anHytsPE; 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=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2503892AbfJXRk0 (ORCPT + 99 others); Thu, 24 Oct 2019 13:40:26 -0400 Received: from hqemgate16.nvidia.com ([216.228.121.65]:6176 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729458AbfJXRkZ (ORCPT ); Thu, 24 Oct 2019 13:40:25 -0400 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== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > * >