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=-5.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,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 F169DC433DF for ; Thu, 28 May 2020 11:04:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CB8F02088E for ; Thu, 28 May 2020 11:04:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="uJk/WRun" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388355AbgE1LE2 (ORCPT ); Thu, 28 May 2020 07:04:28 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:45614 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388111AbgE1LE1 (ORCPT ); Thu, 28 May 2020 07:04:27 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04SB22cU028448; Thu, 28 May 2020 11:04:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2020-01-29; bh=GykrKRB4Fq3/oXzt2FlGK/Xcf5q/CGtXruZ1Dyeo9Co=; b=uJk/WRunkFjD92KjBkp+I2oOHn393wz31ZYFvQRNDXM3yxtC5hXlh+vx1ao1P58QuzlX C9k4P7++ed+FALKes3iRhZPFDsrB98V3YNMUcazWIOohs7OX+uuc41hYS/w+wNdYhBDt kz5zw/VLiGJfHe9XLj+n6kDPaLj6y1G8Ct7eujhPW3kB+xRsqgPV6O+cc8A3h07Tay7J JX7HLI1RoRiYvER2LxtnvvtTvTIRhvK2tEjm5XkjyGN5hqx71s67qSKxpCmZ/HQxAy61 L7NtE9YDfclMgyRCirg+DHRGnxkO2yiQ9WlpFQt0XovE+AXXUegNjT/BmCsqHN/87bh+ uA== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2120.oracle.com with ESMTP id 318xbk4cq1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 28 May 2020 11:04:18 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 04SB3e42131652; Thu, 28 May 2020 11:04:17 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserp3020.oracle.com with ESMTP id 317j5uy09m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 28 May 2020 11:04:17 +0000 Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 04SB4Frw025386; Thu, 28 May 2020 11:04:15 GMT Received: from kadam (/41.57.98.10) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 28 May 2020 04:04:15 -0700 Date: Thu, 28 May 2020 14:04:08 +0300 From: Dan Carpenter To: Souptick Joarder Cc: rspringer@google.com, toddpoynor@google.com, benchan@chromium.org, gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, John Hubbard , linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: gasket: Convert get_user_pages*() --> pin_user_pages*() Message-ID: <20200528110408.GJ30374@kadam> References: <1590613362-27495-1-git-send-email-jrdr.linux@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1590613362-27495-1-git-send-email-jrdr.linux@gmail.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9634 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 spamscore=0 suspectscore=0 mlxlogscore=999 mlxscore=0 adultscore=0 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005280075 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9634 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 spamscore=0 mlxscore=0 lowpriorityscore=0 priorityscore=1501 phishscore=0 cotscore=-2147483648 suspectscore=0 bulkscore=0 clxscore=1011 impostorscore=0 malwarescore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2005280075 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 28, 2020 at 02:32:42AM +0530, Souptick Joarder wrote: > This code was using get_user_pages_fast(), in a "Case 2" scenario > (DMA/RDMA), using the categorization from [1]. That means that it's > time to convert the get_user_pages_fast() + put_page() calls to > pin_user_pages_fast() + unpin_user_page() calls. You are saying that the page is used for DIO and not DMA, but it sure looks to me like it is used for DMA. 503 /* Map the page into DMA space. */ 504 ptes[i].dma_addr = 505 dma_map_page(pg_tbl->device, page, 0, PAGE_SIZE, 506 DMA_BIDIRECTIONAL); To be honest, that starting paragraph was confusing. At first I thought you were saying gasket was an RDMA driver. :P I shouldn't have to read a different document to understand the commit message. It should be summarized enough and the other documentation is supplemental. "In 2019 we introduced pin_user_pages() and now we are converting get_user_pages() to the new API as appropriate". > > There is some helpful background in [2]: basically, this is a small > part of fixing a long-standing disconnect between pinning pages, and > file systems' use of those pages. What is the impact of this patch on runtime? > > [1] Documentation/core-api/pin_user_pages.rst > > [2] "Explicit pinning of user-space pages": > https://lwn.net/Articles/807108/ > > Signed-off-by: Souptick Joarder > Cc: John Hubbard > > Hi, > > I'm compile tested this, but unable to run-time test, so any testing > help is much appriciated. > --- The "Hi" part of patch should have been under the "---" cut off line so this will definitely need to be resent. regards, dan carpenter