Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6441398imu; Wed, 30 Jan 2019 15:00:20 -0800 (PST) X-Google-Smtp-Source: ALg8bN7aqZlte/NoZ3NW+/myXYS/fLMg6wQHKUBmJ/oOE+lRPG4FVV1jK6EmjkWWoN4LjBehnKCn X-Received: by 2002:a62:8096:: with SMTP id j144mr32886040pfd.140.1548889220122; Wed, 30 Jan 2019 15:00:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548889220; cv=none; d=google.com; s=arc-20160816; b=cWxeFkqKAMMJ8kTHQFKXymY/kO5ARFTH8Ag1qOLs50GxxYrb9BQoRCK8QmJJr6u/hx 77YQK2vpw5RLq8BheMlNE91KX7UQDYMq39FeKPNg5+AyoBa+eTZX5qheDqVkRbf5g3G5 am2QQsmQuTQOTaFBcPaj47PWZwD5rFKnHOXtuPnL8vatbMbcrNxrG4dSyz3lBJMKEufk LloTvA6O4ulYgymh4IzFVGgOZjvBXfXc9vOlY1e8VUZxQrla13MX+bjV4lQx8mx1X/lg Vtkv8UrLYFYnJmbfpDMu/IUGtcWU1iK28L9uHoK9YjcOacvZ/o3L19CdZ9wBs3Qp4hN1 0nFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to; bh=2METhPUTcQdLsLxLSU+so3EI4SBEij5n3+DI87XE1zs=; b=uj5Fy5Hr7DUjsMInAexxCQNpkEMx0ph7VmC1PJgJuhogjG6BoJSaf/c9HqC5c7RNwo luW6QYq3TXWQw05oXR0AOFTTslUWxy6FuhuM2bcmeeDdxvvN0zXb4emiKtOEhME4Sc7l pon9V25u+0QdivwDsPNXGoqgcgaED2GPLEcL9EO7bXyblvJ0hhDNBDancny77TJyv5KB UNrwOpig4rDkBRz9RD89agRG3p8g9qwDg/ZJzM0wZO49a4Fc+zw9a2pabHN3lgNtvV3J 5/u5FT8ilMLNQCQNkFEkO76Ly5kYK6oYW0a1cW9ao0ORLHOkGE63tvM8RsASkfOejyTQ TWSA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c2si805490pfg.279.2019.01.30.15.00.04; Wed, 30 Jan 2019 15:00:20 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731816AbfA3VBv (ORCPT + 99 others); Wed, 30 Jan 2019 16:01:51 -0500 Received: from ale.deltatee.com ([207.54.116.67]:41678 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726230AbfA3VBu (ORCPT ); Wed, 30 Jan 2019 16:01:50 -0500 Received: from s01061831bf6ec98c.cg.shawcable.net ([68.147.80.180] helo=[192.168.6.205]) by ale.deltatee.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1gowzL-0000x8-U9; Wed, 30 Jan 2019 14:01:40 -0700 To: Jason Gunthorpe Cc: Christoph Hellwig , Jerome Glisse , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , "Rafael J . Wysocki" , Bjorn Helgaas , Christian Koenig , Felix Kuehling , "linux-pci@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , Marek Szyprowski , Robin Murphy , Joerg Roedel , "iommu@lists.linux-foundation.org" References: <20190129205749.GN3176@redhat.com> <2b704e96-9c7c-3024-b87f-364b9ba22208@deltatee.com> <20190129215028.GQ3176@redhat.com> <20190129234752.GR3176@redhat.com> <655a335c-ab91-d1fc-1ed3-b5f0d37c6226@deltatee.com> <20190130041841.GB30598@mellanox.com> <20190130080006.GB29665@lst.de> <20190130190651.GC17080@mellanox.com> <840256f8-0714-5d7d-e5f5-c96aec5c2c05@deltatee.com> <20190130195900.GG17080@mellanox.com> From: Logan Gunthorpe Message-ID: <35bad6d5-c06b-f2a3-08e6-2ed0197c8691@deltatee.com> Date: Wed, 30 Jan 2019 14:01:35 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190130195900.GG17080@mellanox.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 68.147.80.180 X-SA-Exim-Rcpt-To: iommu@lists.linux-foundation.org, jroedel@suse.de, robin.murphy@arm.com, m.szyprowski@samsung.com, dri-devel@lists.freedesktop.org, linux-pci@vger.kernel.org, Felix.Kuehling@amd.com, christian.koenig@amd.com, bhelgaas@google.com, rafael@kernel.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, jglisse@redhat.com, hch@lst.de, jgg@mellanox.com X-SA-Exim-Mail-From: logang@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-8.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, GREYLIST_ISWHITE autolearn=ham autolearn_force=no version=3.4.2 Subject: Re: [RFC PATCH 3/5] mm/vma: add support for peer to peer to device vma X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-01-30 12:59 p.m., Jason Gunthorpe wrote: > On Wed, Jan 30, 2019 at 12:45:46PM -0700, Logan Gunthorpe wrote: >> >> >> On 2019-01-30 12:06 p.m., Jason Gunthorpe wrote: >>>> Way less problems than not having struct page for doing anything >>>> non-trivial. If you map the BAR to userspace with remap_pfn_range >>>> and friends the mapping is indeed very simple. But any operation >>>> that expects a page structure, which is at least everything using >>>> get_user_pages won't work. >>> >>> GUP doesn't work anyhow today, and won't work with BAR struct pages in >>> the forseeable future (Logan has sent attempts on this before). >> >> I don't recall ever attempting that... But patching GUP for special >> pages or VMAS; or working around by not calling it in some cases seems >> like the thing that's going to need to be done one way or another. > > Remember, the long discussion we had about how to get the IOMEM > annotation into SGL? That is a necessary pre-condition to doing > anything with GUP in DMA using drivers as GUP -> SGL -> DMA map is > pretty much the standard flow. Yes, but that was unrelated to GUP even if that might have been the eventual direction. And I feel the GUP->SGL->DMA flow should still be what we are aiming for. Even if we need a special GUP for special pages, and a special DMA map; and the SGL still has to be homogenous.... > So, I see Jerome solving the GUP problem by replacing GUP entirely > using an API that is more suited to what these sorts of drivers > actually need. Yes, this is what I'm expecting and what I want. Not bypassing the whole thing by doing special things with VMAs. Logan