Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1021616imu; Wed, 16 Jan 2019 11:19:55 -0800 (PST) X-Google-Smtp-Source: ALg8bN6qSrIXNLcxyU+PPTp3stsxJzE2K+exfNLT+KF3+66N3sxsWbeGWc1ZAtDRwcgnrUtXNmKG X-Received: by 2002:a62:824c:: with SMTP id w73mr871184pfd.150.1547666395522; Wed, 16 Jan 2019 11:19:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547666395; cv=none; d=google.com; s=arc-20160816; b=M7tjZ+KRE1PqxKehTeLukxOlgh//VCtMF8GLOdlcjP+xhQ1dPiCT1ED5NvIsoOYPyi hcul3UPONAvbuTBkLAdxCZ3WybEOSW/9f4YL3BzxKvQ4hvGLcB4ay8Yn6jzXpAhy+tib E1l48HQuk+PJkdFH6UWrPdvjRRCcSNZLAVeQiHB4H+QmyEz0vuop0r1oNAOL2TiBFTe3 odWyZEjw0l56iikCBsE3w56OCuuNwas/1UnaX02F8hoNFN+EJGj+0KGCldOLR9S9+HQJ hRy95YTH8bCxLRuiAA29gwtuQRaKU4wDjDs0r6KTk4Hm7I8cHwXlsIQmSpekqEwgKYyU xRTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:reply-to:dkim-signature; bh=9Np+v0nwdYyba8op+9dujYv6+2JU/p/NoCLmU7xwACU=; b=vCI6kHEWqoBw/zYpj6fLgRwT4qnTkFjo3IpIz1wbhworgtnotAVKqlrkLq6uycMRQC XElMrP4BJZ9pdnThV2qUD5NhPSAT4pqcMgxoeNcNUKWJ9KQuIaVvhkQYHcEv3MXSd05t mjPQ8SSZwmU37OZSFjSkgYJVsEy1e+zoo+x9PVR6oDOgPYEXhNmq8uUygM4XOv+1MXdh 7semak8upYquePZWaYIbpyA7ovFQqm7BPbXLDnnrfJguWPzGRlC15Yd4wLUddKSvKV1A 3ZxXifRiK+/rAFrbzXI1YA4UjNz+u0a5JyfFZ2cNTJaCduf7e8j7VWocEEo0I6zCNOtT SLQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XaX1hXxc; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s62si7226271pgc.113.2019.01.16.11.19.37; Wed, 16 Jan 2019 11:19:55 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XaX1hXxc; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392133AbfAPKkw (ORCPT + 99 others); Wed, 16 Jan 2019 05:40:52 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:32959 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392105AbfAPKkw (ORCPT ); Wed, 16 Jan 2019 05:40:52 -0500 Received: by mail-wr1-f66.google.com with SMTP id c14so6379807wrr.0; Wed, 16 Jan 2019 02:40:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=reply-to:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=9Np+v0nwdYyba8op+9dujYv6+2JU/p/NoCLmU7xwACU=; b=XaX1hXxc+maMj3l+h2ty5I0KaMI9rquMFWs/93PjAVF4RLzUGx0zOfw7tHz7xa+SQ7 bTX0VrZsaLWOR8C0EGhwA+HcPvBGgutFzJgaSB9N6VQQ/wGRjUhpzD6C7o7OtN8hG9pb fKbyGGB3RDevAnDw77qP+TI9snucjziGuOyrdDSEY35LgGMKnHZy9z9jFXvstS511K/O yw/A0zZxI8xEhBmqQ3H2+L951Gmq/OifHNvYaFkbwwgiKFo1AOgAfWEeMrWJbSO77lth 67X0ZqxnVRV55qnZtZiRBXnSuSt9w5hcqXVs5399Q6nR674ZGNZD6sfCdv4nXJ1/b24O XZEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:to:cc:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding:content-language; bh=9Np+v0nwdYyba8op+9dujYv6+2JU/p/NoCLmU7xwACU=; b=b2aBNQRBrJCV2BFKTS1M4aZgOhu/L4L4dHytVi9rjMiSmdx56xSOeWzb/qKZJ7SJJk sYY/AGRo+UWDCEoDxDZBO7f0Cw8JXpsm4Zid8wB2KPCvLu2g6YTfcT261/lpiQY8A15J Y7PvxEVyGzSIJmxWPiD+m+Z+MabNoJQl664HQTi0OKpnLHp9jCKr8PJY8URClR+MZKOt tmqsRH0bKT7eb4LWOYC121I9vNFkBMvVCesuvDtL4dUWOcl3+Y94Fxow4k6Wtt7vyWLQ zem11qFZoGSTTqeQtJXebPR0/D6YxGAfbMaOZphGAD6wJs5wquUFHFcar9o8YcFeIKmm hbfw== X-Gm-Message-State: AJcUukeBhvdpO5Gvs2cXcNdwgw8mRWFiFpJOzJalDuCp0lH9Dm8BUEE2 BfclVpRBArfYBB7z1rOUECA= X-Received: by 2002:adf:b190:: with SMTP id q16mr6955550wra.95.1547635250036; Wed, 16 Jan 2019 02:40:50 -0800 (PST) Received: from ?IPv6:2a02:908:1252:fb60:be8a:bd56:1f94:86e7? ([2a02:908:1252:fb60:be8a:bd56:1f94:86e7]) by smtp.gmail.com with ESMTPSA id y1sm40558941wme.1.2019.01.16.02.40.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Jan 2019 02:40:49 -0800 (PST) Reply-To: christian.koenig@amd.com Subject: Re: [PATCH] lib/scatterlist: Provide a DMA page iterator To: Jason Gunthorpe , Thomas Hellstrom Cc: "syeh@vmware.com" , "linux-rdma@vger.kernel.org" , "daniel.vetter@ffwll.ch" , "jian.xu.zheng@intel.com" , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "sakari.ailus@linux.intel.com" , "bingbu.cao@intel.com" , "linux-media@vger.kernel.org" , "shiraz.saleem@intel.com" , "hch@lst.de" , "tian.shu.qiu@intel.com" , "yong.zhi@intel.com" References: <20190104223531.GA1705@ziepe.ca> <20190110234218.GM6890@ziepe.ca> <20190114094856.GB29604@lst.de> <1fb20ab4b171b281e9994b6c55734c120958530b.camel@vmware.com> <20190115212501.GE22045@ziepe.ca> From: =?UTF-8?Q?Christian_K=c3=b6nig?= Message-ID: <744b82a0-bc81-06ee-307b-52ffda705e2c@gmail.com> Date: Wed, 16 Jan 2019 11:40:48 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20190115212501.GE22045@ziepe.ca> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 15.01.19 um 22:25 schrieb Jason Gunthorpe: > On Tue, Jan 15, 2019 at 02:17:26PM +0000, Thomas Hellstrom wrote: >> Hi, Christoph, >> >> On Mon, 2019-01-14 at 10:48 +0100, Christoph Hellwig wrote: >>> On Thu, Jan 10, 2019 at 04:42:18PM -0700, Jason Gunthorpe wrote: >>>>> Changes since the RFC: >>>>> - Rework vmwgfx too [CH] >>>>> - Use a distinct type for the DMA page iterator [CH] >>>>> - Do not have a #ifdef [CH] >>>> ChristophH: Will you ack? >>> This looks generally fine. >>> >>>> Are you still OK with the vmwgfx reworking, or should we go back to >>>> the original version that didn't have the type safety so this >>>> driver >>>> can be left broken? >>> I think the map method in vmgfx that just does virt_to_phys is >>> pretty broken. Thomas, can you check if you see any performance >>> difference with just doing the proper dma mapping, as that gets the >>> driver out of interface abuse land? >> The performance difference is not really the main problem here. The >> problem is that even though we utilize the streaming DMA interface, we >> use it only since we have to for DMA-Remapping and assume that the >> memory is coherent. To be able to be as compliant as possible and ditch >> the virt-to-phys mode, we *need* a DMA interface flag that tells us >> when the dma_sync_for_xxx are no-ops. If they aren't we'll refuse to >> load for now. I'm not sure, but I think also nouveau and radeon suffer >> from the same issue. > RDMA needs something similar as well, in this case drivers take a > struct page * from get_user_pages() and need to have the DMA map fail > if the platform can't DMA map in a way that does not require any > additional DMA API calls to ensure coherence. (think Userspace RDMA > MR's) > > Today we just do the normal DMA map and when it randomly doesn't work > and corrupts data tell those people their platforms don't support RDMA > - it would be nice to have a safer API base solution.. Oh, yes really good point. We have to support get_user_pages (or HMM) in a similar manner on GPUs as well. Regards, Christian. > > Jason > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel