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.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 0D70CC47E49 for ; Thu, 24 Oct 2019 16:10:23 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C12962166E for ; Thu, 24 Oct 2019 16:10:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="QMN3Evm5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C12962166E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 5FE9B6B0003; Thu, 24 Oct 2019 12:10:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5AFBD6B0008; Thu, 24 Oct 2019 12:10:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 477BB6B000E; Thu, 24 Oct 2019 12:10:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0179.hostedemail.com [216.40.44.179]) by kanga.kvack.org (Postfix) with ESMTP id 2861B6B0003 for ; Thu, 24 Oct 2019 12:10:22 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id 96E8B8E5F for ; Thu, 24 Oct 2019 16:10:21 +0000 (UTC) X-FDA: 76079165442.24.taste08_3d44e5fc87a58 X-HE-Tag: taste08_3d44e5fc87a58 X-Filterd-Recvd-Size: 4164 Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by imf34.hostedemail.com (Postfix) with ESMTP for ; Thu, 24 Oct 2019 16:10:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571933420; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=e36bYgYxzu96VpgkIyu2LKZbHdlezcwFd45XXmtDKSI=; b=QMN3Evm5d0q2PTyv10i6EUHympwj5DIcHXzsgY1VCj7YpT4l3wzz4bC61tX/pQwtXQa270 PxHlkUAhNvnWVsrQom813qByP331iCYIYgDDgXmUcS754TXMV0XpqMksUWTUGQDL/rDQYo oOlxrNtJCLi0IGkuzP37YnCRk0CxScs= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-296-2bYyW6FmPjS3LyUzS1ee5w-1; Thu, 24 Oct 2019 12:10:11 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9DC691005528; Thu, 24 Oct 2019 16:10:10 +0000 (UTC) Received: from [10.36.116.202] (ovpn-116-202.ams2.redhat.com [10.36.116.202]) by smtp.corp.redhat.com (Postfix) with ESMTP id B900117F85; Thu, 24 Oct 2019 16:10:09 +0000 (UTC) Subject: Re: [PATCH v2] mm: gup: fix comment of __get_user_pages() To: Liu Xiang , linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, jhubbard@nvidia.com References: <1571929472-3091-1-git-send-email-liuxiang_1999@126.com> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <0839edc8-c876-1713-c753-f12e70e5a653@redhat.com> Date: Thu, 24 Oct 2019 18:10:08 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: <1571929472-3091-1-git-send-email-liuxiang_1999@126.com> Content-Language: en-US X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: 2bYyW6FmPjS3LyUzS1ee5w-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable 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 24.10.19 17:04, Liu Xiang wrote: > Fix comment of __get_user_pages() and make it more clear. >=20 > Suggested-by: John Hubbard > Signed-off-by: Liu Xiang > --- >=20 > Changes in v2: > as suggested by John, rewrite the comment about return value. >=20 > mm/gup.c | 16 +++++++++++----- > 1 file changed, 11 insertions(+), 5 deletions(-) >=20 > 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 *v= ma, unsigned long gup_flags) > *=09=09Or 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. > * >=20 Reviewed-by: David Hildenbrand --=20 Thanks, David / dhildenb