Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp840502ybm; Fri, 29 May 2020 13:34:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRYIN4aHBTlznBbgAw7Z7GQJi1IXwPNRv88JoIAjLilBKdOezTavpx68GTuk2xIV75oaRU X-Received: by 2002:a05:6402:1752:: with SMTP id v18mr9092684edx.107.1590784448922; Fri, 29 May 2020 13:34:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590784448; cv=none; d=google.com; s=arc-20160816; b=ChJwwxPWIgBvtM7iGNAcEL+e4BmacQsANJLNAxUBEYCOL6O5/TF61NAEJUdBbZ2iML tUbAJXSqhnj31f5s8zwG+Av1mpby/G4RNCd07T1IyWvBkprsvQvoBbNqDOyXTkvgOB9n ARffqe36ujWrlpVbJKODsc1SHYRFPiNZXNPDe4VPzu9zuMOomwhjpZnrDGA2kewTcTGQ 3gtZLXZdXo87g1JfiZPZqz/WZofev0Zy1hIN/kNAlyXdNB0JfqW0LIa0jb639IxqaAd/ Q/B3hulHRpBuoGGPqB785M7tYeU2+3SiSmdZz3kYvz5YheLKMPWmxtRSedBHSYKTGisJ YLRg== 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=/zEeOofiTZp0ZN4TMVdNueb74rWQtstcMaq8AqpNAXo=; b=DIl0Y4TGWD4YEt/8NoeFGf8ybxMnz7yTXFAtRaLaE93m0t9OzToLIiXiLScO0h7wZ8 mY2gVaPD2FQG8/5rZ+bKapnzJTnP4BB36TugtZdsIwzsJlfZmyx5f5FkmLk7oWXpFcYx mSeCk91dmeu3Ii363RC8STmK+b++Ma1LypRYCs6snn2zOBIv/1QX6kLKTzp4HDQMobFx EC2i2uJKpyOygEeFpJzoaCJKFTcukI0iyCQDtA6wXil+itbL2mdxMEqNnG9e+fVzDAs1 ddq0DtWEPdSxKsng2DlSU0MUx+QrOJ+PPW8g8JU91+emb5tSkuwjQOBjh5z6YIeMWJh6 dFPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=TNx4pfV1; 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=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t15si3372865edr.173.2020.05.29.13.33.45; Fri, 29 May 2020 13:34:08 -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=@nvidia.com header.s=n1 header.b=TNx4pfV1; 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=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728103AbgE2U2n (ORCPT + 99 others); Fri, 29 May 2020 16:28:43 -0400 Received: from hqnvemgate25.nvidia.com ([216.228.121.64]:19292 "EHLO hqnvemgate25.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726926AbgE2U2m (ORCPT ); Fri, 29 May 2020 16:28:42 -0400 Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Fri, 29 May 2020 13:27:17 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Fri, 29 May 2020 13:28:42 -0700 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Fri, 29 May 2020 13:28:42 -0700 Received: from [10.2.87.173] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 29 May 2020 20:28:41 +0000 Subject: Re: [PATCH] staging: gasket: Convert get_user_pages*() --> pin_user_pages*() To: Dan Carpenter , Souptick Joarder CC: , , , , References: <1590613362-27495-1-git-send-email-jrdr.linux@gmail.com> <20200528110408.GJ30374@kadam> <20200529115330.GO30374@kadam> From: John Hubbard X-Nvconfidentiality: public Message-ID: Date: Fri, 29 May 2020 13:28:41 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.1 MIME-Version: 1.0 In-Reply-To: <20200529115330.GO30374@kadam> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1590784037; bh=/zEeOofiTZp0ZN4TMVdNueb74rWQtstcMaq8AqpNAXo=; h=X-PGP-Universal:Subject:To:CC:References:From:X-Nvconfidentiality: Message-ID:Date:User-Agent:MIME-Version:In-Reply-To: X-Originating-IP:X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=TNx4pfV1Oa5Gt92dyvF6CRTaALmkT1IqZLtRev4uhQqtIZ+IAVkhIXy4c/Ktu6Wjk 3RnO4Goto2RAnvTjfqV+DXrgpiTlBVU6LqoH9louFwwgn/Y72hijNJeeC4Yg6cV7+c 2WiBK1iZmAjABwfMmFeM5FbeOItOax32HVaTLJvlfxH38v3QjK8pzMDVHK3BzhNdht gEPGLsWkNT/2jmvGUFQqlC+KPm/3uVvgbdzWlykBAiRiI+r4/S9wZAUnmm/Pxv7svm 5ISgugk4zGmuDa8pt3c9viPzCcKg3JPaEPkG3CRoV1ftf6P2vdv9ryHTgf6sVY5nI6 +1uHGUPhExX6Q== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-05-29 04:53, Dan Carpenter wrote: ... > What are the runtime implications of this patch? I'm still not clear on > that honestly. Instead of incrementing each page's refcount by 1 (with get_user_pages()), pin_user_pages*() will increment by GUP_PIN_COUNTING_BIAS, which is 1024. That by itself should not have any performance impact, of course, but there's a couple more things: For compound pages of more than 2 page size, it will also increment a separate struct page's field, via hpage_pincount_add(). And finally, it will update /proc/vmstat counters on pin and unpin, via the optimized mod_node_page_state() call. So it's expected to be very light. And, for DMA (as opposed to DIO) situations, the DMA setup time is inevitably much greater than any of the above overheads, so I expect that this patch will be completely invisible from a performance point of view. It would be a "nice to have", though, if anyone were able to do a performance comparison on the gasket driver for this patch, and/or basic runtime verification, since I'm sure it's a specialized setup. thanks, -- John Hubbard NVIDIA