Received: by 2002:ac0:8c9a:0:0:0:0:0 with SMTP id r26csp28234ima; Thu, 31 Jan 2019 11:51:23 -0800 (PST) X-Google-Smtp-Source: ALg8bN6QIA0USJjcpoSIhGh1hKkkwNq7eZXeWr3xtNy4rBwBAhhoNFIkKayvfJL6jDbgZieVa7dO X-Received: by 2002:a63:1c09:: with SMTP id c9mr32345316pgc.200.1548964283297; Thu, 31 Jan 2019 11:51:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548964283; cv=none; d=google.com; s=arc-20160816; b=Q05VS+edZh1E2AhTnqLdFhMMMTVvrC84Bw7JaVrtmbXiwxZyE/X81FZ0u/CHi+pgmL dGgoAVadU6HssRxsFqjMSjIpGPNu3KNhwI9J+CFa4Yy81PCrLbwgItp1jzJOysaHXWys s+5mntv2z8FubQU/AIq2kt3fb2KH0vFrzQKzllTguN6vrQKxLAyS/BKYp7xRWttK1iFM EXq+tG25GEMRVc3gN+3+wSmvs8lKn7Px3aiTrpDu3bdRms8fKg/wA3P/xJOBpwR4uYo9 R6ugqniXay/rDnezNXToXbLDQ3cbbkLWMwgdHE9iVHdn89uS6TiiZR+iXGAaSsZFRLCa 8fpQ== 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=0o4vhTA4NO2rqrBFyR4se9S2ZEfxlXHdQ1c/HXiw8Y8=; b=gkEklHjXBU/PRBPXIBSIJe5Cw+qWo1X1YZHDlvEC3PLMZ8HI4++07ejlQPVEbmDmkp NdfyAaTqdwRXZuRebS2fGVoRSkbtUcW/rF/Fc0z3Ff3j9braGF9/gOJk2BbrhbbZU4WN Ln8EnFAjydl6tXS3P70BqFfLDzPiAHXebVGB3h82mXCp3eE00jZrz2iafseGOzEop2QM 0RvXaVEpvm+xo6ui23n5CHBOWAPXkEeASnF148emaAVRMcfXBldzSmRjbS608PhhcQdR AQOq1vNcQA8d4r+2R1xnTUrp15OSfkCGkd3qp4yWM+VhZykFbI58flEuE2THJd6klNYd dzbw== 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 11si4869228pgs.126.2019.01.31.11.51.07; Thu, 31 Jan 2019 11:51:23 -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 S1728220AbfAaTo3 (ORCPT + 99 others); Thu, 31 Jan 2019 14:44:29 -0500 Received: from ale.deltatee.com ([207.54.116.67]:50398 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725855AbfAaTo3 (ORCPT ); Thu, 31 Jan 2019 14:44:29 -0500 Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtp (Exim 4.89) (envelope-from ) id 1gpIG3-0002ds-Dl; Thu, 31 Jan 2019 12:44:20 -0700 To: Jerome Glisse , Jason Gunthorpe Cc: Christoph Hellwig , "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: <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> <20190131193513.GC16593@redhat.com> From: Logan Gunthorpe Message-ID: Date: Thu, 31 Jan 2019 12:44:17 -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: <20190131193513.GC16593@redhat.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, hch@lst.de, jgg@mellanox.com, jglisse@redhat.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:35 p.m., Jerome Glisse wrote: > So what is this O_DIRECT thing that keep coming again and again here :) > What is the use case ? Note that bio will always have valid struct page > of regular memory as using PCIE BAR for filesystem is crazy (you do not > have atomic or cache coherence and many CPU instruction have _undefined_ > effect so what ever the userspace would do might do nothing. The point is to be able to use a BAR as the source of data to write/read from a file system. So as a simple example, if an NVMe drive had a CMB, and you could map that CMB to userspace, you could do an O_DIRECT read to the BAR on one drive and an O_DIRECT write from the BAR on another drive. Thus you could bypass the upstream port of a switch (and therefore all CPU resources) altogether. For the most part nobody would want to put a filesystem on a BAR. (Though there have been some crazy ideas to put persistent memory behind a CMB...) > Now if you want to use BAR address as destination or source of directIO > then let just update the directIO code to handle this. There is no need > to go hack every single place in the kernel that might deal with struct > page or sgl. Just update the place that need to understand this. We can > even update directIO to work on weird platform. The change to directIO > will be small, couple hundred line of code at best. Well if you want to figure out how to remove struct page from the entire block layer that would help everybody. But until then, it's pretty much impossible to use the block layer (and therefore O_DIRECT) without struct page. Logan