Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1211952imu; Wed, 16 Jan 2019 14:55:39 -0800 (PST) X-Google-Smtp-Source: ALg8bN5rPKOANb7awoOvkyF/BD3ckiU6QOip+kfzy11Wn7AeCY0NiNMdnkqMdsBHzlPDWBGNVfWw X-Received: by 2002:a63:ab08:: with SMTP id p8mr10857420pgf.87.1547679339524; Wed, 16 Jan 2019 14:55:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547679339; cv=none; d=google.com; s=arc-20160816; b=VUpccln/nayiG85FiWrcJRopcoq44aBJMAliLAa8WG2D86zbU0UhMl1KZ4BtDFBF4F 1WOiLjWKxcNsOpN9GYr+39BJqME+fExriRN/xtFCY/G9P3ULsMLun3sldgfsPv9cjr4E +GhpzRxyfGyHUB30GSmEiVF1DTVOeTQw1rHeVcMInt0ri75qu7gGCJFJlWXNFwjlkaBk irE17/EKEDxTpRC8Uy2OKwqXD8NBVi0ixpgqnDIppAihHA1j3LMftt3I8zf6r6//wlFY /3r1sp2pJ6TKGvV18XXSCbxnt7nzvxdfgkf2b14Plsrl1UFaTG+31tb8nplAhrAoy6cj KJPA== 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=XvCN4KnA3/0Bhg2FSej8uuyKX5WEZcZISib3o2NDbY0=; b=lS8t9enfPm30pvZbRnUwJtIhZ8tOw6RmAShcPVx53NBMe7cRdN5+Th/72duRzByFHu uW4Wp2RMuMFaXcS+PrcOtr/ukiwq/FBBbikw5DsvfiA/bK5qxCkEIgIv6s/STjTm40Kb PCmD+G8DuOAA9tEw8Us5Fy2HjI19cBxWJdlSjSSFwlUvnyIa9Qdl/qtm30XdDHsjksPO fVyu94yV+dFN74H62QObZZ3HyetTTvQ9KFrehN6HHR/DM1/94xehqHFhJ4QCKci3LN2l 1tqYWDbK/e5ePN0RIN2nqGA/fqiKqCG+zaSkEsKArWij9zpSXTtjevMowsgc598eaCoh 4Hsw== 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 p23si6986781pgk.312.2019.01.16.14.55.23; Wed, 16 Jan 2019 14:55:39 -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 S2405278AbfAPQLi (ORCPT + 99 others); Wed, 16 Jan 2019 11:11:38 -0500 Received: from verein.lst.de ([213.95.11.211]:60328 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405272AbfAPQLg (ORCPT ); Wed, 16 Jan 2019 11:11:36 -0500 Received: by newverein.lst.de (Postfix, from userid 2407) id 01C9368CEB; Wed, 16 Jan 2019 17:11:35 +0100 (CET) Date: Wed, 16 Jan 2019 17:11:34 +0100 From: "hch@lst.de" To: Jason Gunthorpe Cc: Thomas Hellstrom , "hch@lst.de" , "linux-kernel@vger.kernel.org" , "yong.zhi@intel.com" , "daniel.vetter@ffwll.ch" , "linux-rdma@vger.kernel.org" , "syeh@vmware.com" , "linux-media@vger.kernel.org" , "bingbu.cao@intel.com" , "imre.deak@intel.com" , "tian.shu.qiu@intel.com" , "jian.xu.zheng@intel.com" , "shiraz.saleem@intel.com" , "sakari.ailus@linux.intel.com" , "dri-devel@lists.freedesktop.org" Subject: Re: [PATCH] lib/scatterlist: Provide a DMA page iterator Message-ID: <20190116161134.GA29041@lst.de> References: <20190104223531.GA1705@ziepe.ca> <20190110234218.GM6890@ziepe.ca> <20190114094856.GB29604@lst.de> <1fb20ab4b171b281e9994b6c55734c120958530b.camel@vmware.com> <20190115212501.GE22045@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190115212501.GE22045@ziepe.ca> 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 15, 2019 at 02:25:01PM -0700, Jason Gunthorpe wrote: > 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) Any time you dma map pages you need to do further DMA API calls to ensure coherent, that is the way it is implemented. These calls just happen to be no-ops sometimes. > 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.. Now that all these drivers are consolidated in rdma-core you can fix the code to actually do the right thing. It isn't that userspace DMA coherent is any harder than in-kernel DMA coherenence. It just is that no one bothered to do it properly.