Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp671207pxk; Thu, 17 Sep 2020 12:57:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrWyMqmEAA8v/iE34ZOjiAwXAJ1oCt167LA9lqOI6JZthOrzaiDoHJtQzvpTSPsRH8kj7v X-Received: by 2002:a17:906:4cc6:: with SMTP id q6mr32795728ejt.201.1600372667983; Thu, 17 Sep 2020 12:57:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600372667; cv=none; d=google.com; s=arc-20160816; b=GX5Z086rzMgK78n6N9PnpjQwhwJkjEWfQ/ptNo4HZmCeVs8mBQHzTpCSf8w/D64mcM 6h5DrYKF2UugJr+tVW/AK+rlTrVrsFP4fu+60ReaRzvI+voCANfsGHAX+95cgw147m+b CwBszXCpYbNchc4Nf2T965AbL4btwcejDzY8DO280ZbbUWA/N9O4hKvgr37R/3HgSRmu d7gIYpdR+6/9vxWN/4HCnBbncZTuAxAsrouXaU4xEQZEwoVaar1MWfOiiukrYABrblXB Txy3sFFEfw1I+gaDZ/vqRSfMoDbvnFBOa9jgic0Ty631Loos2dP0+smmeIEIeCK3Ge0f 9DFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=1+Mrfdy5duzyBhCJDTygdYru375hdyXmBf78tKAvjJc=; b=PDMf8ocL0U7f9ll14JlvUC/zhGJZeRSs5AFpUx3qJs5ShMaPNFKps2TCsYPNp4IcMF sCSJWj1rG63Phn7OvHwHtS26Geb7XO3FWeVF7sfKyREU4pNa6I8e5v2UWK5x2lsVKWPp xRFU1ulyj4PCxi0gdD3mmKyAIXUeI9WJH3uSxEjCBKG1In9O2WW2jjs2iEkOXR7kJVE5 Yxi8M6MYIg/MuqxNSlGXkHP9ihAJm0iWmSJUiTSho0sF9gmzNd1Odwtml0y5WZOckb4E yToQX+ikoFKAVZEbYsjTAXpy2pl2MVpwbUDDpCOT0nZGx2Xm6aLFe4vuGZcjLApMWeei YXhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=hB2NxzFK; 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 y9si630983ejg.460.2020.09.17.12.57.24; Thu, 17 Sep 2020 12:57:47 -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=hB2NxzFK; 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 S1726736AbgIQTzi (ORCPT + 99 others); Thu, 17 Sep 2020 15:55:38 -0400 Received: from hqnvemgate26.nvidia.com ([216.228.121.65]:1964 "EHLO hqnvemgate26.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726491AbgIQTzf (ORCPT ); Thu, 17 Sep 2020 15:55:35 -0400 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== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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