Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10946981ybi; Thu, 25 Jul 2019 07:28:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqyVqnJgkshtVZpDlfwXL9yDyGErJKF2yFhFIXCa/7r3brth69To5k8eYZa8GLa4TsrJUpBC X-Received: by 2002:a62:7890:: with SMTP id t138mr8616405pfc.238.1564064906972; Thu, 25 Jul 2019 07:28:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564064906; cv=none; d=google.com; s=arc-20160816; b=Ay6gADSXUx929SF1ABau3+1pc8vHb8hijFAQjia1vRAu8xcsdPwjMDCqA//Xsp3669 skbGYGcJiHvt+2Iv2npSWU2U5g6grQGMOB5vbzY+c3wL7GfqpgWMbhykFvt7eOJUwXX2 qsnrWqybhsxq+qK5+WwowUUCs/BBe2800GAJrV5QC6ZiguiojNyco9oZSNWgSJAgaIu0 Okc8iHMC/uVGy74p9PHoCkKRj/+nS5OxTzKFgVs10OnmB92/zZjj5fZFJuLrcrEiYBL5 VxZ9Dpo+8+BTEKnXjjZO3tTsp/n17PP++Y16eyVR5vemmRQJzoULL4oKB1fBqg5AMlMy hk0g== 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; bh=1joWEMQcLM+9YSoj5rlIs3pivlXRiqlH0/8S4ycCPoY=; b=AYig+5dTD8LloCEMTJqUayNiPJa2lEZ5/2Q4L6R8tFl1sisrmbd4Wl+uAhwkcNHzlg 5xE9ybpSZzLy0vvAUf02cQy7YAh6aXQO+tIe9iSxsDmNcpVjuRFuuoaAwZnqzSZVJ2zz jNQksoLMaUCqRNLk9aP0e+2VjQkG3p47PIr1XxLp53pjLRJH1ZGx0iLFWhorSMsEarlu b8OxVRKw0c61gMyuI/B6Dy+lbDG4+k9u5cNqkkc56Y5gkUoeUxwI1G++cq3SFp1fWrVr QAQE44v4KPR1KEcNH7E80uu4MqhnKOzOEblr1kphWMS+6m1HaRvw1sI0nNcOt0OOzovA jBGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=d+3dJJOK; 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 n21si19302787pgf.339.2019.07.25.07.28.12; Thu, 25 Jul 2019 07:28:26 -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=d+3dJJOK; 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 S1728467AbfGYOEu (ORCPT + 99 others); Thu, 25 Jul 2019 10:04:50 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:58382 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727209AbfGYOEt (ORCPT ); Thu, 25 Jul 2019 10:04:49 -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=1joWEMQcLM+9YSoj5rlIs3pivlXRiqlH0/8S4ycCPoY=; b=d+3dJJOKVxgyE0HGPBv/Ub5Pi 8ZNkwfm17H8avnq/qSh4DobZVl7b7s1ZASqKjtlBKPGsmk3wRI5Qbbxkys/kZkcWYg02Ip0OvTkdI ZZduotlcoq7vXMJVf15h9y6rWTGMsMqxV8Gwwdlg2Z/S2DxY74ljHi0t7VfeuayMnPd2WfLhxDM2y /h2ahK0mluNJuNPPZGti+5N44cQZ25hE7yq+yp8VaAcbbL7mYtRnNf/dGml1G0XxeSNHoRwGzIWT8 FCig2SBsHjq5u8eK48GGbnVYchinTcnWgcTF25ouC1sPoI7zvrIHrSpsHLdGGaOTKIeCc8VR8FtMD qRAjbM+xA==; Received: from hch by bombadil.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1hqeMS-0007lj-1V; Thu, 25 Jul 2019 14:04:48 +0000 Date: Thu, 25 Jul 2019 07:04:48 -0700 From: Christoph Hellwig To: "Andrew F. Davis" Cc: Christoph Hellwig , John Stultz , lkml , Laura Abbott , Benjamin Gaignard , Sumit Semwal , Liam Mark , Pratik Patel , Brian Starkey , Vincent Donnefort , Sudipto Paul , Xu YiPing , "Chenfeng (puck)" , butao , "Xiaqing (A)" , Yudongbin , Chenbo Feng , Alistair Strachan , dri-devel Subject: Re: [PATCH v6 4/5] dma-buf: heaps: Add CMA heap to dmabuf heaps Message-ID: <20190725140448.GA25010@infradead.org> References: <20190624194908.121273-1-john.stultz@linaro.org> <20190624194908.121273-5-john.stultz@linaro.org> <20190718100840.GB19666@infradead.org> <20190724065958.GC16225@infradead.org> <8e6f8e4f-20fc-1f1f-2228-f4fd7c7c5c1f@ti.com> <20190725125014.GD20286@infradead.org> <0eae0024-1fdf-bd06-a8ff-1a41f0af3c69@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0eae0024-1fdf-bd06-a8ff-1a41f0af3c69@ti.com> User-Agent: Mutt/1.11.4 (2019-03-13) 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 Thu, Jul 25, 2019 at 09:31:50AM -0400, Andrew F. Davis wrote: > But that's just it, dma-buf does not assume buffers are backed by normal > kernel managed memory, it is up to the buffer exporter where and when to > allocate the memory. The memory backed by this SRAM buffer does not have > the normal struct page backing. So moving the map, sync, etc functions > to common code would fail for this and many other heap types. This was a > major problem with Ion that prompted this new design. The code clearly shows it has page backing, e.g. this: + sg_set_page(table->sgl, pfn_to_page(PFN_DOWN(buffer->paddr)), buffer->len, 0); and the fact that it (and the dma-buf API) uses scatterlists, which requires pages.