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=-6.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS 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 631A1C433DF for ; Sun, 31 May 2020 06:43:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 02E6320723 for ; Sun, 31 May 2020 06:43:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Y6b0nQig" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 02E6320723 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4B4CF8E0006; Sun, 31 May 2020 02:43:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4646F8E0003; Sun, 31 May 2020 02:43:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 354318E0006; Sun, 31 May 2020 02:43:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0189.hostedemail.com [216.40.44.189]) by kanga.kvack.org (Postfix) with ESMTP id 19A018E0003 for ; Sun, 31 May 2020 02:43:00 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id C351B181AEF1A for ; Sun, 31 May 2020 06:42:59 +0000 (UTC) X-FDA: 76876071678.04.egg37_37360a7eac30e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin04.hostedemail.com (Postfix) with ESMTP id A4984800FCBD for ; Sun, 31 May 2020 06:42:59 +0000 (UTC) X-HE-Tag: egg37_37360a7eac30e X-Filterd-Recvd-Size: 6110 Received: from mail-lf1-f67.google.com (mail-lf1-f67.google.com [209.85.167.67]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Sun, 31 May 2020 06:42:59 +0000 (UTC) Received: by mail-lf1-f67.google.com with SMTP id c12so2071740lfc.10 for ; Sat, 30 May 2020 23:42:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=sqGZTy1VqOexcid65oEqQ0+wrF0QdU2KCXSQUQInTJc=; b=Y6b0nQigzK2NweGGGk31Ubu51PGKGcmPfj3MeMagnsT016n5zsTOxGVagrxYlsUF5E A+XYAvsnVi7Wyaw5rDfSqav6CC2hwwlcqRwqKBDN5GOThuHzQ1sFo6Q7irbczLv4A4bU X44+e3Yuv432OI500QGSpq9iHKJknbEnRfCZruzfT85ij9QxnDtJXLk/W1XQ2nHAJyWT ImUR51WrKDg0v9KuhGieicUM+r/5tEc7bUbI+646ziZGEwAhBBdc06d9L27AoeA9IxhX Vj+mpYi+sr7M/KNQ/LibV9dw/sqeukVii/1bRGWmPQwXNe5xxTnlX1itO2G/BLWPZONb 8shQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=sqGZTy1VqOexcid65oEqQ0+wrF0QdU2KCXSQUQInTJc=; b=r8//s8JkLkSjJj/x+MwiDkjwdRGv8aH2ZZFniezP6xsxDQCy648Ma56TYCVWlTWusc sRDb1uIRJ0Urstf/yEN0qr+ig3rulCNYwpzwWuG+gNydbv1y/kgbFLikG8WqZ/iWSUsr EBbXC478ZkvkINDzqANg5pslfqE6o1mQUp8XupaNm1DqSELJe71wiwuEM7pxe4gpMhep MgZmv+wPA+BXZw4BbKadZncxon64vk3hnGpVoOtht4BnAa7a3erq8iy14spAL34xEjBF 9NjbNDLmvKEDL1ggL1NJZfh46oJYGmYqRvIHJ38c7Tko9dOo0+DvuHxd446hwNbLs3gC xM1A== X-Gm-Message-State: AOAM533qZRUqk2criLsHHhuezOXz7pTMoFD/1pZ6ScuOArJV8ni9fBjF SnGUjhfbU2DoVcM3GSetKN8An3OYMHp3JkAc/TQ= X-Google-Smtp-Source: ABdhPJwvjnc1PCInE8i4TlX+kufQSoXGXtRTv3a5hDdmx8ySRDNuW08+ZajG7rq7Oqy101E/ckI70VCYf7Vjii2f5rE= X-Received: by 2002:ac2:53a2:: with SMTP id j2mr8170978lfh.139.1590907377726; Sat, 30 May 2020 23:42:57 -0700 (PDT) MIME-Version: 1.0 References: <20200529084515.46259-1-jhubbard@nvidia.com> <37811e3c-cf0c-eb52-0365-7980a9c0f334@redhat.com> In-Reply-To: <37811e3c-cf0c-eb52-0365-7980a9c0f334@redhat.com> From: Souptick Joarder Date: Sun, 31 May 2020 12:21:05 +0530 Message-ID: Subject: Re: [PATCH] mm/gup: documentation fix for pin_user_pages*() APIs To: David Hildenbrand Cc: John Hubbard , Andrew Morton , LKML , Linux-MM , Dan Carpenter , Jan Kara , Vlastimil Babka Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: A4984800FCBD X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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 Fri, May 29, 2020 at 2:41 PM David Hildenbrand wrote: > > On 29.05.20 10:45, John Hubbard wrote: > > All of the pin_user_pages*() API calls will cause pages to be > > dma-pinned. As such, they are all suitable for either DMA, RDMA, > > and/or Direct IO. The documentation should say so, but it was > > instead saying that three of the API calls were only suitable for > > Direct IO. This was discovered when a reviewer wondered why an > > API call that specifically recommended against Case 2 (DMA/RDMA) > > was being used in a DMA situation [1]. > > > > Fix this by simply deleting those claims. The gup.c comments already > > refer to the more extensive Documentation/core-api/pin_user_pages.rst, > > which does have the correct guidance. So let's just write it once, > > there. > > > > [1] https://lore.kernel.org/r/20200529074658.GM30374@kadam > > > > Cc: Dan Carpenter > > Cc: Jan Kara > > Cc: Vlastimil Babka > > Signed-off-by: John Hubbard > > --- > > > > Hi, > > > > This applies on top of linux-next, in order to avoid a conflict with > > Mauro Carvalho Chehab's fix to the lines right above these. > > > > thanks, > > John Hubbard > > NVIDIA > > > > > > mm/gup.c | 9 --------- > > 1 file changed, 9 deletions(-) > > > > diff --git a/mm/gup.c b/mm/gup.c > > index ee039d421746d..311d0f11b35e6 100644 > > --- a/mm/gup.c > > +++ b/mm/gup.c > > @@ -2875,9 +2875,6 @@ EXPORT_SYMBOL_GPL(get_user_pages_fast); > > * > > * FOLL_PIN means that the pages must be released via unpin_user_page(). Please > > * see Documentation/core-api/pin_user_pages.rst for further details. > > - * > > - * This is intended for Case 1 (DIO) in Documentation/core-api/pin_user_pages.rst. It > > - * is NOT intended for Case 2 (RDMA: long-term pins). > > */ > > int pin_user_pages_fast(unsigned long start, int nr_pages, > > unsigned int gup_flags, struct page **pages) > > @@ -2951,9 +2948,6 @@ EXPORT_SYMBOL_GPL(pin_user_pages_fast_only); > > * > > * FOLL_PIN means that the pages must be released via unpin_user_page(). Please > > * see Documentation/core-api/pin_user_pages.rst for details. > > - * > > - * This is intended for Case 1 (DIO) in Documentation/core-api/pin_user_pages.rst. It > > - * is NOT intended for Case 2 (RDMA: long-term pins). > > */ > > long pin_user_pages_remote(struct task_struct *tsk, struct mm_struct *mm, > > unsigned long start, unsigned long nr_pages, > > @@ -2987,9 +2981,6 @@ EXPORT_SYMBOL(pin_user_pages_remote); > > * > > * FOLL_PIN means that the pages must be released via unpin_user_page(). Please > > * see Documentation/core-api/pin_user_pages.rst for details. > > - * > > - * This is intended for Case 1 (DIO) in Documentation/core-api/pin_user_pages.rst. It > > - * is NOT intended for Case 2 (RDMA: long-term pins). > > */ > > long pin_user_pages(unsigned long start, unsigned long nr_pages, > > unsigned int gup_flags, struct page **pages, > > > > Reviewed-by: David Hildenbrand Acked-by : Souptick Joarder > > -- > Thanks, > > David / dhildenb >