Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp163466imu; Fri, 14 Dec 2018 16:44:44 -0800 (PST) X-Google-Smtp-Source: AFSGD/V3PN9ld20Ep/QYsIQmrFhoim4Ra7o877us4iUzWiMJSWYNsjXaD9AcaRMpHh2sk8H4HSXI X-Received: by 2002:a63:6cc8:: with SMTP id h191mr4381718pgc.366.1544834684590; Fri, 14 Dec 2018 16:44:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544834684; cv=none; d=google.com; s=arc-20160816; b=caoD4dVce2xLiPRBlBXIbgOuqowtoCRGyeMpcRE3LPXXIQaffuNwMUnXmzI1BkiyRp UMiPA6oFeo4hpUXgnxZsEL/cC+BHwuI9hpUCg4skRCwLsKY2GItjQCRyMv5ZH+Fu01A/ mBwV2gOAZZT8kbc+xEm8QOTnqt1tv+sykPAEN+AlOkuKDg0/k54qBykC6s7c4tiABU43 hIXRw0HB7K+cciOx/BPH/89dMp8LioLcq02c9iuDaJ70Ivct/j9UdknulAuTqe6b7ZBX aITz6U17rFMdICHySg0MYDBOt/ybN+KdJ2Rc12txRTGAm6O6z//7USt2TC9MhpmxW2kw 3u+A== 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=i9A7NGiDtHXHbUOZwuytamOlJYVGbUTQePeWLbdBzVc=; b=EkSxLiH041DjdFOuHgoiM4hJiWA5+zjRf9+NhAzmEm48rjvd7+VpVnqG2+2SRKtul+ GLepgJWT/oa6gy3ubbIpXs1PsM4n20/+zL9Hllui2ebCwzAEB7ij1GevRIXkbcjnWboL sQ8Yt/gPQ71cvBD3qbGTRE5Od5WH5/biCaUKZP1KsTOoSmPyCky7t1HKs8IkWSa3PhqS nm30mUANS4dy4KJr/chigo9l0JIDUTb1YHDXz/Q0hnw45WCLLoWFiWKA2xv3c4DxUhO9 /WZ+xE9CKTGQLmtcaOFSaz4rqm8AmOKUv5oe2icSLvWgJIacfs0o3yz5amTUexlJcsHs OW7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=lqP0WN3r; 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 l81si5276268pfj.230.2018.12.14.16.43.52; Fri, 14 Dec 2018 16:44:44 -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=lqP0WN3r; 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 S1729184AbeLOAl4 (ORCPT + 99 others); Fri, 14 Dec 2018 19:41:56 -0500 Received: from hqemgate15.nvidia.com ([216.228.121.64]:13020 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727634AbeLOAl4 (ORCPT ); Fri, 14 Dec 2018 19:41:56 -0500 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Fri, 14 Dec 2018 16:41:51 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Fri, 14 Dec 2018 16:41:55 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Fri, 14 Dec 2018 16:41:55 -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; Sat, 15 Dec 2018 00:41:55 +0000 Subject: Re: [PATCH 1/2] mm: introduce put_user_page*(), placeholder versions To: Matthew Wilcox , Dave Hansen CC: Dan Williams , david , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Jan Kara , 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: <20181212150319.GA3432@redhat.com> <20181212214641.GB29416@dastard> <20181212215931.GG5037@redhat.com> <20181213005119.GD29416@dastard> <05a68829-6e6d-b766-11b4-99e1ba4bc87b@nvidia.com> <01cf4e0c-b2d6-225a-3ee9-ef0f7e53684d@nvidia.com> <20181214194843.GG10600@bombadil.infradead.org> <20181214200311.GH10600@bombadil.infradead.org> X-Nvconfidentiality: public From: John Hubbard Message-ID: <2e9396f4-f0c8-8ae2-8044-cd4807d61bca@nvidia.com> Date: Fri, 14 Dec 2018 16:41:54 -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: <20181214200311.GH10600@bombadil.infradead.org> 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=1544834511; bh=i9A7NGiDtHXHbUOZwuytamOlJYVGbUTQePeWLbdBzVc=; h=X-PGP-Universal:Subject:To:CC:References:X-Nvconfidentiality:From: Message-ID:Date:User-Agent:MIME-Version:In-Reply-To: X-Originating-IP:X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=lqP0WN3ra6mRBvdp4c7ODAL3qEsdTv4vanidxF9jum+4gQlUnqHseOuI8lqoPlj0j NcraRuCx7kxOtEwCJonPikQbEGjL9m3rbHCcE4Ht/qxpE8UyBHMA4nZ1AD49164pKl kvP4k6EzX582HKXLCqM00fmfjw+NLxytxFt7RHf1EhoRfrsJb/bMf5fg9QYJmMhAC+ 6IDK2H3XnEQmYxcdKuPcU1EUiGfuTjAGHQuK8pRJ2cTiXRKWMD/Ph3hMzCyANPef7f heYZCLCAqosn40l7IcJWnL38sGQkX7luAOZyGm1FuKgt4CiMP9nZ6N4uq3dqyF7Yx6 4LqE6BuEHJNsA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/14/18 12:03 PM, Matthew Wilcox wrote: > On Fri, Dec 14, 2018 at 11:53:31AM -0800, Dave Hansen wrote: >> On 12/14/18 11:48 AM, Matthew Wilcox wrote: >>> I think we can do better than a proxy object with bit 0 set. I'd go >>> for allocating something like this: >>> >>> struct dynamic_page { >>> struct page; >>> unsigned long vaddr; >>> unsigned long pfn; >>> ... >>> }; >>> >>> and use a bit in struct page to indicate that this is a dynamic page. >> >> That might be fun. We'd just need a fast/static and slow/dynamic path >> in page_to_pfn()/pfn_to_page(). We'd also need some kind of auxiliary >> pfn-to-page structure since we could not fit that^ structure in vmemmap[]. > > Yes; working on the pfn-to-page structure right now as it happens ... > in the meantime, an XArray for it probably wouldn't be _too_ bad. > OK, this looks great. And as Dan pointed out, we get a nice side effect of type safety for the gup/dma call site conversion. After doing partial conversions, the need for type safety (some of the callers really are complex) really seems worth the extra work, so that's a big benefit. Next steps: I want to go try this dynamic_page approach out right away. If there are pieces such as page_to_pfn and related, that are already in progress, I'd definitely like to work on top of that. Also, any up front advice or pitfalls to avoid is always welcome, of course. :) thanks, -- John Hubbard NVIDIA