Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5606702imu; Wed, 30 Jan 2019 00:03:03 -0800 (PST) X-Google-Smtp-Source: ALg8bN5J9mnomGh/DkCIXKMmnAFU80iQnqy8vVGngDJegHA367ngi0fv4eKbKFCsCvigmMWyjvb/ X-Received: by 2002:a65:6491:: with SMTP id e17mr26432031pgv.418.1548835383062; Wed, 30 Jan 2019 00:03:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548835383; cv=none; d=google.com; s=arc-20160816; b=gcI4C/CH3Vghi6aM8BrgCQHt4PWH6ch+HYkdmbd7go20FGT9Qku/WOPhdQf5q+mRZb 2IlbGy+y94pIXyFQCXejbZLatcmN4VuChHsf0OIln4k0zcl1/TfsTfhKFpbAXXRM9qWH oK0OuL7ZeMkHv1K/ftM2ljxgXoYwwZKII9Yg88ECi6HbHnfTfZCFs/KYtZzKWIvcsGqN an0v38iJDc+fWU28cKAapH3V0xg7xvP9UWdYxgDXWr97dxO7RElRwqj+AKKNrQ37r1sO Y1BAzc3BlShndtxbNZbViboGEzeSOVScyVjHJ3ccTcOkNr60c8xlJLrq6GRRvNSrodzT Ueuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=bSvzEOpTuQZUwQLSOSlYFpmxHnqbqpoLNfEkerIfslQ=; b=AIqM+lwp1NuguB+kwXu0aIYjQeYF65hs8pjsytS7a+vxbSLoPayFDEcBcdOaxvQHwR ZsvayXIXTwv44h6na9f+vfWgpEXv/+3QsZL/ME0X9s3anMYF4BqP1jLy3lfGUDfPj7v3 gKOA2HWOogD2AvBBO49P2XKLDOM+52QrNJ1Qt/NlOa6nKfwQX7iGOP+jZ5Ll2w72B+7c ChtjsyVi9XPFzVXbv7jpGCCu2/LuUy3qlCW/z2NbNA03JMWMHu/QNQtZuk2xREb5Eu26 xDO0gSZhn+RHrIYdMzlMQ451ON2EyWHd/HvtB1Iols3OujIQDPuh1SqsdxB/uxG16LZf NG5Q== 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 w14si839586plq.145.2019.01.30.00.02.47; Wed, 30 Jan 2019 00:03:03 -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 S1728672AbfA3ICL (ORCPT + 99 others); Wed, 30 Jan 2019 03:02:11 -0500 Received: from verein.lst.de ([213.95.11.211]:50781 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725830AbfA3ICL (ORCPT ); Wed, 30 Jan 2019 03:02:11 -0500 Received: by newverein.lst.de (Postfix, from userid 2407) id BF4D968CEC; Wed, 30 Jan 2019 09:02:08 +0100 (CET) Date: Wed, 30 Jan 2019 09:02:08 +0100 From: Christoph Hellwig To: Jason Gunthorpe Cc: Logan Gunthorpe , 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" , Christoph Hellwig , Marek Szyprowski , Robin Murphy , Joerg Roedel , "iommu@lists.linux-foundation.org" Subject: Re: [RFC PATCH 3/5] mm/vma: add support for peer to peer to device vma Message-ID: <20190130080208.GC29665@lst.de> References: <20190129174728.6430-1-jglisse@redhat.com> <20190129174728.6430-4-jglisse@redhat.com> <20190129191120.GE3176@redhat.com> <20190129193250.GK10108@mellanox.com> <99c228c6-ef96-7594-cb43-78931966c75d@deltatee.com> <20190129205827.GM10108@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190129205827.GM10108@mellanox.com> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 29, 2019 at 08:58:35PM +0000, Jason Gunthorpe wrote: > On Tue, Jan 29, 2019 at 01:39:49PM -0700, Logan Gunthorpe wrote: > > > implement the mapping. And I don't think we should have 'special' vma's > > for this (though we may need something to ensure we don't get mapping > > requests mixed with different types of pages...). > > I think Jerome explained the point here is to have a 'special vma' > rather than a 'special struct page' as, really, we don't need a > struct page at all to make this work. > > If I recall your earlier attempts at adding struct page for BAR > memory, it ran aground on issues related to O_DIRECT/sgls, etc, etc. Struct page is what makes O_DIRECT work, using sgls or biovecs, etc on it work. Without struct page none of the above can work at all. That is why we use struct page for backing BARs in the existing P2P code. Not that I'm a particular fan of creating struct page for this device memory, but without major invasive surgery to large parts of the kernel it is the only way to make it work.