Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp9756ima; Thu, 31 Jan 2019 11:30:51 -0800 (PST) X-Google-Smtp-Source: ALg8bN5EeslMIWwTy4CU79FwJF+l8hq7EJV/eR5A1II4QearpUfkaoJB3XxsrVABMiOiMiMoSHc2 X-Received: by 2002:a17:902:7c85:: with SMTP id y5mr35853366pll.63.1548963051855; Thu, 31 Jan 2019 11:30:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548963051; cv=none; d=google.com; s=arc-20160816; b=YTiEV3szGrAN7GG47BX6e7AdquvchvVJd1fGf1W3SBK70H9oz95z3E1wQDpeXrQtTp otXC65fpZ/eIbTt3rFcUXjXA81eUR4bHXWUvB7UJK9Us4hsp/NSv3+4kHCH+hgaBqYH8 /coimF+VhGuEi7bH54FgxeL2I9oTBcxlcZpdy2wHKQwIBIlei62IoYA0VBNJA0OjnMDm JxJHnoQwg0zzO/HDBE/3JUW9eQQR472RydWt6nKF6VEm4OUfEEn0+ErtfQqsTEm3bENB ghz8vHfLiMCmpp/tsEFL8j53JRkJ6wAiIivR8Gy9LW8LS8P0Zoc2GxHqIWuPuLH1bG42 aLqg== 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=5Vc8ZUnqjhO0zFhlxW2NETZ1/Nee5MEwnQEwZBj6gus=; b=kHxiKxNFXO2SwL7lqFuLRe6Pt5ZcX4qZvEfwUMV5laGVisDWVf8ZoO3BxIehx4LZyO q/u4Mp9SU6iG8gsfMEYwv7FU/SMuIy+//GYrEdZ/5xrcbVumsYvYEgGQjJaLxIdlY5GY AYid3c9Z4il7ArwDXRqtRvRzJC5KV7fO7DL8m/P8Avv9dzer11WsFYyQdcQtCghj8t6j IYQlxlNHkKd7q2Y144Rf0gCGejiYTJ/qvl9oRFVFYx3RirzEsVQqXBR1sVhFMsqnz4sw 5ZbV8e7z3hQSGgkqhisOyaSmHhFcNUQfIuOzZwwYLcMOr6iCF1okPMFjF0/FsFqe2FKM e72g== 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 v13si2779511pgn.355.2019.01.31.11.30.30; Thu, 31 Jan 2019 11:30:51 -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 S1728444AbfAaTTs (ORCPT + 99 others); Thu, 31 Jan 2019 14:19:48 -0500 Received: from ale.deltatee.com ([207.54.116.67]:50232 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726233AbfAaTTs (ORCPT ); Thu, 31 Jan 2019 14:19:48 -0500 Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtp (Exim 4.89) (envelope-from ) id 1gpHsA-0002Rf-H6; Thu, 31 Jan 2019 12:19:39 -0700 To: Jason Gunthorpe , Christoph Hellwig Cc: 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: <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> <35bad6d5-c06b-f2a3-08e6-2ed0197c8691@deltatee.com> <20190130215019.GL17080@mellanox.com> <07baf401-4d63-b830-57e1-5836a5149a0c@deltatee.com> <20190131081355.GC26495@lst.de> <20190131190202.GC7548@mellanox.com> From: Logan Gunthorpe Message-ID: Date: Thu, 31 Jan 2019 12:19:31 -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: <20190131190202.GC7548@mellanox.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-CA Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 172.16.1.162 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-31 12:02 p.m., Jason Gunthorpe wrote: > I still think the right direction is to build on what Logan has done - > realize that he created a DMA-only SGL - make that a formal type of > the kernel and provide the right set of APIs to work with this type, > without being forced to expose struct page. > Basically invert the API flow - the DMA map would be done close to > GUP, not buried in the driver. This absolutely doesn't work for every > flow we have, but it does enable the ones that people seem to care > about when talking about P2P. > It also does present a path to solve some cases of the O_DIRECT > problems if the block stack can develop some way to know if an IO will > go down a DMA-only IO path or not... This seems less challenging that > auditing every SGL user for iomem safety?? The DMA-only SGL will work for some use cases, but I think it's going to be a challenge for others. We care most about NVMe and, therefore, the block layer. Given my understanding of the block layer, and it's queuing infrastructure, I don't think having a DMA-only IO path makes sense. I think it has to be the same path, but with a special DMA-only bio; and endpoints would have to indicate support for that bio. I can't say I have a deep enough understanding of the block layer to know how possible that would be. Logan