Received: by 10.192.165.156 with SMTP id m28csp430732imm; Thu, 19 Apr 2018 01:19:00 -0700 (PDT) X-Google-Smtp-Source: AIpwx48/hzpHwuV0pSJOeP6uVwOS0wv9LwnspQYoQrY/kHcjqqPSzFm5AXNoqL3CS5tiEXSumAoZ X-Received: by 10.99.120.196 with SMTP id t187mr4434739pgc.149.1524125940311; Thu, 19 Apr 2018 01:19:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524125940; cv=none; d=google.com; s=arc-20160816; b=Hq+GWaruRiMwbjzqYPcHmghb2Gm0Jnpky1Ikb/k8lqMJawNVEIVyh4p7Tr+iftj9r6 5BetMPXH2+cCORTHpvl9x/2OunEA6I2jh4j/80z17PeBaIz5d4lBg9NdcD3s2bYQ/gdg lcC5JHpWKrQ9OyWazYkZ7BHxURwlIZp1J2XmrWkxlIMRMuL3j9znIYyNYINEN9W7nLbc 46UR6uN1Rf66rtuqxvdRbU4X88MDBpEzrDYwKBvXW+a88TEEJ0wPt3RFJ9RYKCes4IJj wtrHJtFmaBjngr7HBpkcIaKHuOa1N6HEXB2u5lt39tUkEGeZ2ym31OAxSg/AX9v2EgeY rZxw== 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:dkim-signature:arc-authentication-results; bh=rSxLDcsjucMKZ8c7j1Q2VjOjkqEjsN0vAZhxSWe7MNg=; b=JrtQn43x7lPMhVGRlriMTjQaOQhx0Ckn8MptsrNPR/VCq1eDHVLxZ+WZJ/Gyv3Q//L Et8tSTAeh68PhTNpKubR0D+l6DZ2VUNIFziCM3Y8tQNStiXN/yRK9Lte7Sk63lLc0TOp KXML3itttsMriknR6Q0R0G7zyRqG9XkpNRcWJbCe1TRnw3MR2Xf48JN5BCr0hYYJK0S6 SdsFdzJlOa6dpXt06iDup17SnBQiYtEN/buzZM2oiaTW1Lh1RdXAHf+dI9sMDGpDb51w MOvhg5t3XAUzYDOZANjNfG1Yqg1rextodV4q063IHlkgJR2OJiEHXkeV0aAvgLbAfM/D fyZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=HKDFxAbJ; 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 z6si2492972pgv.684.2018.04.19.01.18.46; Thu, 19 Apr 2018 01:19:00 -0700 (PDT) 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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=HKDFxAbJ; 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 S1751830AbeDSIRG (ORCPT + 99 others); Thu, 19 Apr 2018 04:17:06 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:59916 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750972AbeDSIRD (ORCPT ); Thu, 19 Apr 2018 04:17:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=rSxLDcsjucMKZ8c7j1Q2VjOjkqEjsN0vAZhxSWe7MNg=; b=HKDFxAbJgXF+dnDZvhCANCuSY WV4WXIjd4hrbBGKecbI/PWcsruX2jMf2yHjj/889qzGZMRBC4ynRPKbtxLdIDm3bnDBIXHHIefjmt WnSyuIKJfSV0pYH4mVTpjvx4Knzh5RIDixDMp0G8GfVmK3riga4vt8hOHa2aP7ZpF0xm1M/5yqigX FdzDaUGlS5+pYGZFuW3fSaiLAVPuvJwL/D6QDdIfn+zj1BM1eOn1BDAPi650LXp6YKO+sa0TS4fE2 oxrJqNJ7htNpBc+wvXeYxJZxcGhnQu8GprE+swWIHVQt69CdLBO91VjfW2wRxCZAG38gGxxjz453r 9Z8LER3FQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1f94kT-0006j5-GB; Thu, 19 Apr 2018 08:16:57 +0000 Date: Thu, 19 Apr 2018 01:16:57 -0700 From: Christoph Hellwig To: Daniel Vetter Cc: Christoph Hellwig , Jerome Glisse , Christian =?iso-8859-1?Q?K=F6nig?= , "moderated list:DMA BUFFER SHARING FRAMEWORK" , "open list:DMA BUFFER SHARING FRAMEWORK" , dri-devel , amd-gfx list , Linux Kernel Mailing List , Logan Gunthorpe , Dan Williams Subject: Re: [PATCH 4/8] dma-buf: add peer2peer flag Message-ID: <20180419081657.GA16735@infradead.org> References: <20180325110000.2238-1-christian.koenig@amd.com> <20180325110000.2238-4-christian.koenig@amd.com> <20180329065753.GD3881@phenom.ffwll.local> <8b823458-8bdc-3217-572b-509a28aae742@gmail.com> <20180403090909.GN3881@phenom.ffwll.local> <20180403170645.GB5935@redhat.com> <20180403180832.GZ3881@phenom.ffwll.local> <20180416123937.GA9073@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 16, 2018 at 03:38:56PM +0200, Daniel Vetter wrote: > We've broken that assumption in i915 years ago. Not struct page backed > gpu memory is very real. > > Of course we'll never feed such a strange sg table to a driver which > doesn't understand it, but allowing sg_page == NULL works perfectly > fine. At least for gpu drivers. For GPU drivers on x86 with no dma coherency problems, sure. But not all the world is x86. We already have problems due to dmabugs use of the awkward get_sgtable interface (see the common on arm_dma_get_sgtable that I fully agree with), and doing this for memory that doesn't have a struct page at all will make things even worse. > If that's not acceptable then I guess we could go over the entire tree > and frob all the gpu related code to switch over to a new struct > sg_table_might_not_be_struct_page_backed, including all the other > functions we added over the past few years to iterate over sg tables. > But seems slightly silly, given that sg tables seem to do exactly what > we need. It isn't silly. We will have to do some surgery like that anyway because the current APIs don't work. So relax, sit back and come up with an API that solves the existing issues and serves us well in the future.