Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp1839337ybm; Sat, 30 May 2020 23:49:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJ75Etty/xI5cLQF/Xr1oWIy8cTuGzqxsh+zcgHlEWUsccXY/e1sT8pNxC1QBXzqlihqfw X-Received: by 2002:a50:d499:: with SMTP id s25mr279510edi.161.1590907770992; Sat, 30 May 2020 23:49:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590907770; cv=none; d=google.com; s=arc-20160816; b=qxy4csHTjbuLVsSldG0Lo4ityICj7fpiXXSE2fstZHxl4JWX8sh0G88JlEa06Htpl0 7EegQlf/dQyzKwrkCCuu+hLzI83LTmBczHQwVlH8eETqKKRtfseDRv8/GY3hJdaatzUS 28cxML3wn9AmhlztCjKAM+uo0b+bWIgc0/lhUA46i0pgAYRZqYWk930wHB2NFCnphNOb +N+AHLMYhH9mLVaR6OxULEcLNLL9I3WiRF0mm77dm5ErV8Iam80cwQilgjM8yNxG3cil 9NCBPN6FaN8L24mRSUirK7RGOItLCb9+juQ9U9hRPbtKmH0KObC3XUvijOgZ4Uiw6CGq f4bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=sqGZTy1VqOexcid65oEqQ0+wrF0QdU2KCXSQUQInTJc=; b=cPNN/hvw64jRESZ4X0PuGAhFbHs1tJyQgeAHVGcuTFtONmBKfpgwiHomggdzaLJfrL 5LoWsPd9p/TwYsICJQtfBXtzDFZyUT2R6uYsQZNKurdR1RtE8QcRsuU7k1JxRdqydP91 /9DX7IGJu0VHdhD8xS8unQiMNHRjlQKpsS4LRiteT30TTfaFDcYWJqbS1bXCbCO1Ewlx 4AGXfsrs8sJRoG0XdyjrgJIVd6juyx5vcJItpGos307DV5e4RQWh6KUOqsGfxZdKIiwC 6MeclvClwITcMnMS1jea4t0SwWqurH3xzxws1RlPOoe/4AkQin8YVfyZRHCoLqFy7JHm tRVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Y6b0nQig; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k21si3692326edx.60.2020.05.30.23.49.07; Sat, 30 May 2020 23:49:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Y6b0nQig; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729651AbgEaGnB (ORCPT + 99 others); Sun, 31 May 2020 02:43:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725895AbgEaGnA (ORCPT ); Sun, 31 May 2020 02:43:00 -0400 Received: from mail-lf1-x141.google.com (mail-lf1-x141.google.com [IPv6:2a00:1450:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F769C05BD43 for ; Sat, 30 May 2020 23:43:00 -0700 (PDT) Received: by mail-lf1-x141.google.com with SMTP id 202so2085988lfe.5 for ; Sat, 30 May 2020 23:43:00 -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=G7St1pzIyAfwxNKp08z2RWju7uv/zIYGYO5Se+qv2txBxPKRrGgdhcs5eDEMxC9/w/ OlvL8joLso3QkrUgNvrzVSwucrrmSFye4pT6tnZzPi2Hyb/upiGXuuWC4rvyDzxyWhyp MrS+jyBR5EkADyX2q7FZ4V6t5lVSxoAMPlrVCCuE/c9JoQa99p0NxisNvbakBlotHJKQ MybarnxowIoI0uGegFpiS60W36OG4Emw0curPoot1VYEz41jZQujnBZrOjj1AhvjVUTH daawXvO3RXwWAwSK1rTXHEz/ffB1tv9H+nB+Eusu4GOdjC32wdnOVwO0NwyfAlVMLxG0 +SWw== X-Gm-Message-State: AOAM532R206u67PbJCmpbIXzd/hIFGttwc3qoJmn1UhTBFrd5SbRvH15 3l8fmBXEGag9ttgY6bcW+LymkHZgNzNgigSAbXl89DCF 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" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >