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=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,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 72FA4C43461 for ; Thu, 17 Sep 2020 19:55:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 008C2206DB for ; Thu, 17 Sep 2020 19:55:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="hB2NxzFK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 008C2206DB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 231A66B0037; Thu, 17 Sep 2020 15:55:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1E2DF6B0055; Thu, 17 Sep 2020 15:55:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0F8606B005C; Thu, 17 Sep 2020 15:55:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0091.hostedemail.com [216.40.44.91]) by kanga.kvack.org (Postfix) with ESMTP id EF05B6B0037 for ; Thu, 17 Sep 2020 15:55:37 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id B0B48181AEF30 for ; Thu, 17 Sep 2020 19:55:37 +0000 (UTC) X-FDA: 77273608314.26.mint21_050942227125 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin26.hostedemail.com (Postfix) with ESMTP id 8A20F1804B661 for ; Thu, 17 Sep 2020 19:55:37 +0000 (UTC) X-HE-Tag: mint21_050942227125 X-Filterd-Recvd-Size: 4543 Received: from hqnvemgate26.nvidia.com (hqnvemgate26.nvidia.com [216.228.121.65]) by imf40.hostedemail.com (Postfix) with ESMTP for ; Thu, 17 Sep 2020 19:55:36 +0000 (UTC) Received: from hqpgpgate102.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Thu, 17 Sep 2020 12:55:22 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate102.nvidia.com (PGP Universal service); Thu, 17 Sep 2020 12:55:35 -0700 X-PGP-Universal: processed; by hqpgpgate102.nvidia.com on Thu, 17 Sep 2020 12:55:35 -0700 Received: from [10.2.52.182] (172.20.13.39) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 17 Sep 2020 19:55:34 +0000 Subject: Re: [PATCH 1/4] mm: Trial do_wp_page() simplification To: Linus Torvalds , Peter Xu CC: Jason Gunthorpe , Leon Romanovsky , Linux-MM , Linux Kernel Mailing List , "Maya B . Gokhale" , "Yang Shi" , Marty Mcfadden , "Kirill Shutemov" , Oleg Nesterov , Jann Horn , Jan Kara , Kirill Tkhai , Andrea Arcangeli , "Christoph Hellwig" , Andrew Morton References: <20200915191346.GD2949@xz-x1> <20200915193838.GN1221970@ziepe.ca> <20200915213330.GE2949@xz-x1> <20200915232238.GO1221970@ziepe.ca> <20200916174804.GC8409@ziepe.ca> <20200916184619.GB40154@xz-x1> <20200917112538.GD8409@ziepe.ca> <20200917181411.GA133226@xz-x1> <20200917190332.GB133226@xz-x1> From: John Hubbard Message-ID: <29a76f98-ddc5-4fc1-92ed-3eff01130b11@nvidia.com> Date: Thu, 17 Sep 2020 12:55:34 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: X-Originating-IP: [172.20.13.39] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) 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=1600372522; bh=1+Mrfdy5duzyBhCJDTygdYru375hdyXmBf78tKAvjJc=; h=X-PGP-Universal:Subject:To:CC:References:From:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:X-Originating-IP: X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=hB2NxzFKSVfLYWQQEDc12bT89tFoOKFak4i4XVIIP0ApjS015JhzC11fjYXTgSIf2 1VcxhlqcDjhLhMfu0SuLlvCKn0sKjozMrKDScrmnFDrumwTV3P6q+nEkRDf2boOpNM EmstdSw2/ManEGNC0G37AEoYtNbte8kwtZupGEHPV0mRsvF3uTfozGppwP5cE4qG3h YtNqfnCK7a3T373c4DxP4c5kA43v+zxGKF0JqP4ubcE603Lqh3TEWUvolC/SS6R0pl pNV4WxcVK8ryThk9qgSd7iA877BBfLmHX8landEgg7L6qL0Xr8EhIq3VE7g06AGo0c jTdZTRhSgnEWg== 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 9/17/20 12:42 PM, Linus Torvalds wrote: > On Thu, Sep 17, 2020 at 12:03 PM Peter Xu wrote: ... > > Is there possibly somethign else we can filter on than just > GUP_PIN_COUNTING_BIAS? Because it could be as simple as just marking > the vma itself and saying "this vma has had a page pinning event done > on it". > > Because if we only start copying the page *iff* the vma is marked by > that "this vma had page pinning" _and_ the page count is bigger than > GUP_PIN_COUNTING_BIAS, than I think we can rest pretty easily knowing > that we aren't going to hit some regular old-fashioned UNIX server > cases with a lot of forks.. > > Linus OK, so this sounds like an improvement that would be desirable in the core API: 1) Have all the pin_user_pages*() functions reach up and mark the vma(s) as FOLL_PIN_HAPPENED. I'm assuming that the vma can live it's full life without the need to ever clear that flag. That *seems* reasonable, based on the use cases for these kinds of pages. 2) And then rename: page_maybe_dma_pinned() --> page_likely_dma_pinned() :) thanks, -- John Hubbard NVIDIA