Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp168999imu; Wed, 12 Dec 2018 14:19:05 -0800 (PST) X-Google-Smtp-Source: AFSGD/UmiALPvJ2Xamb5QCVTYXPFJUwIfFgc+YMy1tR3HuSy2vk7UIV3ZJxcaQ5rOzSJjjQh4Cj6 X-Received: by 2002:a62:f5da:: with SMTP id b87mr22188671pfm.253.1544653145124; Wed, 12 Dec 2018 14:19:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544653145; cv=none; d=google.com; s=arc-20160816; b=Xqahhi7RsxYOBYch3InaUAwtfl/G2whgbhQI/UQ83SxjnuleEynNnI/x+mnuzFcmnp 9UTGX9Xb3gL8cY+sBUTn4NL8sQe2qN2UbEIPuDgDhLwxgvorh8sQGsKpYxsXI2BJwsxT SUYxUES0QZGmtcPuB7ywtQP61xRweyvmCDRK7aBJbIF0lWBLpnSCS2n4QUgsPgwGT9hU sAQma6hhVND/yeMjCbr3M7JKd8Cjxr/f0Eubm7jlKfbGQm4b+s4Q3VusiZZaU33VdYHZ SpIQwxkiYEI01v0w4TEugQdkc4CyfC0rWqy6O6Qe/Ya5GB0OZsaliHGwFvpfXUSuoJaq v98Q== 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=WSBF5BoWMhSw1y8bxFCZvm4e+XFb5iL3/hlj9E+wdtQ=; b=s/M/NNaxb/oT0jBUJat3rJwXv2xnysozhXOTMtRuJmN826pN8/BJ8HBGlJSlYqgu3j 8SENhdnHcuo+HPmsybNOcn5PvJBH+Ck7RnoNfQw6iNYd4a+mXeAgBCa8xdGODJoNvWy5 bOJlUyf91erva/MoTIlFSdBrB+Oa2utr8fUuJ8KF4qz4v3fqv8lfvt1AWV8TGtkYeb0u 6HQ8df7n/PDwOnw3gNtfdG8G/cidFBhSP2oHBRkySc3a0roDydCL507AMz+ZgN6L93Rj RXqgrDhXc+vlx6B3SCnwcYoanQHw1xGPL8u1Ze/LHrQidW4ApEoKb1V+BPXTFxMr63AI TK+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=hgkaOWuA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id k72si11442pge.310.2018.12.12.14.18.50; Wed, 12 Dec 2018 14:19:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=hgkaOWuA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1728791AbeLLWRg (ORCPT + 99 others); Wed, 12 Dec 2018 17:17:36 -0500 Received: from hqemgate16.nvidia.com ([216.228.121.65]:10092 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728337AbeLLWRd (ORCPT ); Wed, 12 Dec 2018 17:17:33 -0500 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Wed, 12 Dec 2018 14:17:24 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Wed, 12 Dec 2018 14:17:28 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Wed, 12 Dec 2018 14:17:28 -0800 Received: from [10.110.48.28] (10.124.1.5) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 12 Dec 2018 22:17:28 +0000 Subject: Re: [PATCH 1/2] mm: introduce put_user_page*(), placeholder versions To: Jerome Glisse CC: Dan Williams , Jan Kara , Matthew Wilcox , John Hubbard , Andrew Morton , Linux MM , , Al Viro , , Christoph Hellwig , Christopher Lameter , "Dalessandro, Dennis" , Doug Ledford , Jason Gunthorpe , Michal Hocko , Mike Marciniszyn , , Linux Kernel Mailing List , linux-fsdevel References: <20181207191620.GD3293@redhat.com> <3c4d46c0-aced-f96f-1bf3-725d02f11b60@nvidia.com> <20181208022445.GA7024@redhat.com> <20181210102846.GC29289@quack2.suse.cz> <20181212150319.GA3432@redhat.com> <20181212213005.GE5037@redhat.com> <514cc9e1-dc4d-b979-c6bc-88ac503c098d@nvidia.com> <20181212220418.GH5037@redhat.com> <311cd7a7-6727-a298-964e-ad238a30bdef@nvidia.com> <20181212221446.GI5037@redhat.com> From: John Hubbard X-Nvconfidentiality: public Message-ID: <2483bf1b-944e-ad3b-74f6-773a0aa8813c@nvidia.com> Date: Wed, 12 Dec 2018 14:17:27 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.3 MIME-Version: 1.0 In-Reply-To: <20181212221446.GI5037@redhat.com> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL104.nvidia.com (172.18.146.11) To HQMAIL101.nvidia.com (172.20.187.10) Content-Type: text/plain; charset="utf-8" Content-Language: en-US-large Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1544653044; bh=WSBF5BoWMhSw1y8bxFCZvm4e+XFb5iL3/hlj9E+wdtQ=; 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=hgkaOWuAPiGd1hMtFupnP2yJu/+oR7hIw4buwpSVnaI7SnZWcGnX/VtEMAN66Qe0z oydhxFrwW7RSk4iSd/CcDffotKNrtiRhVPp7IkQ/3wa2eyyy2PFhqD8LoI7dVfLWEL JvgNUfPkjaQPg3ZXSt9JDsA/fwK4UN9Kd9Nw6KZhd1zeTZxjGjFR0skG/djqDc+IE6 /JoXvpIuph5l03Aw0igMJNS7o7rxbGW742FWltKUa4Z4PER1oamfRZ0PYUMGmbTZVX vlvxjBT1rz6uq+y9gpp/pTDW9yN4Up0girGsYNPUa1jJNQUtaGg3xajfIMm8FRvNbK 3qa2CzeoB1GAw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/12/18 2:14 PM, Jerome Glisse wrote: > On Wed, Dec 12, 2018 at 02:11:58PM -0800, John Hubbard wrote: >> On 12/12/18 2:04 PM, Jerome Glisse wrote: >>> On Wed, Dec 12, 2018 at 01:56:00PM -0800, John Hubbard wrote: >>>> On 12/12/18 1:30 PM, Jerome Glisse wrote: >>>>> On Wed, Dec 12, 2018 at 08:27:35AM -0800, Dan Williams wrote: >>>>>> On Wed, Dec 12, 2018 at 7:03 AM Jerome Glisse wrote: >>>>>>> >>>>>>> On Mon, Dec 10, 2018 at 11:28:46AM +0100, Jan Kara wrote: >>>>>>>> On Fri 07-12-18 21:24:46, Jerome Glisse wrote: [...] >>> >>>>> Patch 1: register mmu notifier >>>>> Patch 2: listen to MMU_NOTIFY_TRUNCATE and MMU_NOTIFY_UNMAP >>>>> when that happens update the device page table or >>>>> usage to point to a crappy page and do put_user_page >>>>> on all previously held page >>>> >>>> Minor point, this sequence should be done within a wrapper around existing >>>> get_user_pages(), such as get_user_pages_revokable() or something. >>> >>> No we want to teach everyone to abide by the rules, if we add yet another >>> GUP function prototype people will use the one where they don;t have to >>> say they abide by the rules. It is time we advertise the fact that GUP >>> should not be use willy nilly for anything without worrying about the >>> implication it has :) >> >> Well, the best way to do that is to provide a named function call that >> implements the rules. That also makes it easy to grep around and see which >> call sites still need upgrades, and which don't. >> >>> >>> So i would rather see a consolidation in the number of GUP prototype we >>> have than yet another one. >> >> We could eventually get rid of the older GUP prototypes, once we're done >> converting. Having a new, named function call will *without question* make >> the call site conversion go much easier, and the end result is also better: >> the common code is in a central function, rather than being at all the call >> sites. >> > > Then last patch in the patchset must remove all GUP prototype except > ones with the right API :) > Yes, exactly. thanks, -- John Hubbard NVIDIA