Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp190934imu; Thu, 20 Dec 2018 19:57:22 -0800 (PST) X-Google-Smtp-Source: ALg8bN6GORj4jhfVsHHzmrwEy1aPYRt6A/eZxrTFmt7WR3kXja8IiZBik3aUohGFS69UdJrrtKvv X-Received: by 2002:a63:c904:: with SMTP id o4mr842829pgg.331.1545364641973; Thu, 20 Dec 2018 19:57:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545364641; cv=none; d=google.com; s=arc-20160816; b=mRKad5VYOnF4C1kuB25K40djtfj24f4r1p0g9N3TknW64YqKSyGnlCls+bWPhRunWR qNNwJukq4iZSxYF9GlTeZu214RpgN14XBgluFwYf2dOywP061AV22DDthuuN8yvcfeTB qnEcI4quhUH2AEOs0WY5lN1kbK2L+TKmWZIqDEMclVf7VWLs27t3lKFljCxzCnxzgLRR ietQ/jqLYspSucyjaEJG+Hr3sYU7roU9JNP0+GsZonbiIJtgwIHYx1LFJaH+aWwd5Pff F9A6/nNCVJqEr0w8DRug+OMV3MnZrAGxL1mgbAOWVNJ0ERV5bW3h4UfRvEoLadTWjxv3 sSBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=VRAYsH2vnfRBNF1ip+ybzuzgKrpXCMUBIqg0huRiZn4=; b=gSYRssINDZeDlTUMA3rFW0B8MDpS25nMasqFoDK19JsQWFtW516MhKaravPLmlSana blW/hGu+VThuwDNo25jGRnbjpqAB/5qY+H6dSBC4ndPHm093XUYTp37ARlMtLruCv7si iMxGMw8PEKLkSBu1aRSMZJL+IPw1TH4xUF6tFCLO+i21I2t62ruJPJs65QSQciMSwfTv huWsWjtoc5dG21PhkO9ec+C5ioFB1Tg/6SBxOa70js6Z9xOvKUBo/HabweO/COud/J93 wdmKM3evr0OJuA8fbay5qa/4AMY+leAE1M1UUtSMoIrs3P5u1CbPvGH867fHzT2XG1/v Z7mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=By7ejdPh; 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 y17si11836456pll.10.2018.12.20.19.57.05; Thu, 20 Dec 2018 19:57:21 -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=@ffwll.ch header.s=google header.b=By7ejdPh; 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 S2389183AbeLTS3v (ORCPT + 99 others); Thu, 20 Dec 2018 13:29:51 -0500 Received: from mail-it1-f194.google.com ([209.85.166.194]:40249 "EHLO mail-it1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733143AbeLTS3u (ORCPT ); Thu, 20 Dec 2018 13:29:50 -0500 Received: by mail-it1-f194.google.com with SMTP id h193so3117018ita.5 for ; Thu, 20 Dec 2018 10:29:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VRAYsH2vnfRBNF1ip+ybzuzgKrpXCMUBIqg0huRiZn4=; b=By7ejdPhRS5/TfASPZUHsQSyNlsmkFT1gxncEszms9zKsTBtNrig/XVeMAgNzJtN5b wxg6pAR1d+IgVi26TtJuKrHX/x6v5yZqzWS95weE2DpkbLgi660MEn77tni9EpFGJb+O WPDtQGu7Id8OWRqJRsJsGbPnk3LBFT4LF4I8Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VRAYsH2vnfRBNF1ip+ybzuzgKrpXCMUBIqg0huRiZn4=; b=QZYfwbliz2O+5TTi6kvgCaiMqB7puGDXpCyIUCOkX0+XZSHW8RPihbEUGc7j1NE28w 7SxP6N4xR9p6Si0hEwS3pbhnuBNtjmvy0gISzPrRvCA1DqwzxBvNGLgTt4MIqJXjNNo8 9Q1kDwjtAYwUUP25q1fXjSD0TURfXWPD1yqXMw8XiDDaHuEmo+gzFmgD0d98pAe2Soe9 spyndni6MfpIj9vsTLSYRGG6fokPXv+qWDOoK4rBWqxr+dWGwsrGd7G6e3fIbR9WJMC0 Nhan1KdNJWkQsfM0YKYAGS7QnGfUjy9SjMvs6XVjZRMJU6AFVbGZF7xLmyNFui5kYl8H DOPw== X-Gm-Message-State: AA+aEWYRjtRXQihSftmKKE6XDoKlU+hrDblY0DcjQy/VNfbI5jLQ7T1f byuq9ScnPOec87KHOISF0U4eVuO8p9DA00/bWTobCA== X-Received: by 2002:a05:660c:344:: with SMTP id b4mr10559562itl.51.1545330589207; Thu, 20 Dec 2018 10:29:49 -0800 (PST) MIME-Version: 1.0 References: <20181127103252.20994-1-andr2000@gmail.com> <17640791-5306-f7e4-8588-dd39c14e975b@tronnes.org> <20181220153646.GA22997@infradead.org> <20181220173950.GA19641@infradead.org> In-Reply-To: <20181220173950.GA19641@infradead.org> From: Daniel Vetter Date: Thu, 20 Dec 2018 19:29:37 +0100 Message-ID: Subject: Re: [PATCH] drm/xen-front: Make shmem backed display buffer coherent To: Christoph Hellwig Cc: Oleksandr Andrushchenko , Juergen Gross , Oleksandr Andrushchenko , Linux Kernel Mailing List , dri-devel , Daniel Vetter , xen-devel@lists.xenproject.org, boris.ostrovsky@oracle.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 20, 2018 at 6:39 PM Christoph Hellwig wrote: > > On Thu, Dec 20, 2018 at 05:49:39PM +0200, Oleksandr Andrushchenko wrote: > > This is the only patch [1], no series. And at the moment I think > > there is nothing to review as I am not sure how to deal with those > > shmem pages: this patch is rather to start a discussion on how shmem > > pages can be flushed on ARM (the only workaround I have so far is > > in this patch which uses DMA API). This is where I am looking for > > some advice, so I can implement the patch the right way. > > shmem is basically page cache. So you need to use the DMA streaming > API (dma_map_*) to map it for DMA. You need to make sure no one > access the kernel mapping at the same time as you do DMA to it, > so the pages should be locked. This is how the normal file system > I/O path works. I wasn't around back then, but afaiui drm uses shmem because that was the only way mm folks let us have swappable memory. We proposed a gemfs a while ago to be able to mix up our own allocator with that, wasn't approved. What we most definitely not want to end up with though is actually streaming dma, because with that all the zero copy buffer sharing tricks become pointless. There's pretty epic amounts of hacks to work around this, I have no idea what's supposed to give here. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch