Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10947042ybi; Thu, 25 Jul 2019 07:28:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqxxWVm0juwThN936g9FZBHzQ5JJGqL5oXfJ5Ec5ZuqM5ryQx6XEvvoTNtTdrCPGZLv/PWKa X-Received: by 2002:a63:f304:: with SMTP id l4mr85750173pgh.66.1564064911376; Thu, 25 Jul 2019 07:28:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564064911; cv=none; d=google.com; s=arc-20160816; b=L4yKfWXLxcF0JK16v0mUr44IVKf0e25rPQEzQXCgKXLJ0BVW8l50hxOojADYhRI/dY J3iwuOdSiHOUFyJ3gac4yLxiIJ008VSGTUjLdj1+PPe3aYyPPBeE6l9gUZpVjyOdrj/q pQ5CZxp1wLve8Q+dOOc2Qu55L8dbLvtjJRxickJ5OIPvxneYvSVQjYnzj6JYgs7UhIqZ xlHrcknFBVaKTPZoGJPiqukS6eJVezRBYz3rM26pIK5m0+5HYnq+uvK8ZCPHCWr8QIcg 5r2iL/nHd8pmn1vSIfzAS90vOdodvy9ezNDLDmkrm/5bweVcJ31dL0hYQor4ls68QlNr 18Xg== 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=7+BaHSDvnuGwzorwA9PLsy47qF1uCR3WQcWR5zaTyNI=; b=fX8j6WIZvztWYZIraHZjzIAQoauSQsWatUNZks8Soc8T01jDFVPnlMP2zrd5t6f1QN 2LuxKJCUQrijQFbQOIXbbvTkJQjM45y4pD+lKi9JY2aycdTjeVUC8mjpRMSHXEsM/gRL OmEqM/xHgnMP1sq/CTS4Iw9vs4PJ/xqJPcmNLMcKLUT3/+aJeQtNZpRTmy3w+Qkc0jiG JGUB1tT7WXOyjWwEsYWymXEocLiEu1jHtHNIp2mKGFTU+3JVzVD5dHcK7RJPsxCog2Po nln7bOrtfsfbqIMIJGFwbHULQEAPQtMis/0+UwpTiyY3G94cA2mcZriBD+xOiJRt2Kfl eKRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=kvjs2WCz; 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 bc7si17738130plb.55.2019.07.25.07.28.16; Thu, 25 Jul 2019 07:28:31 -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=kvjs2WCz; 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 S1728605AbfGYOFt (ORCPT + 99 others); Thu, 25 Jul 2019 10:05:49 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:58450 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727681AbfGYOFt (ORCPT ); Thu, 25 Jul 2019 10:05: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=7+BaHSDvnuGwzorwA9PLsy47qF1uCR3WQcWR5zaTyNI=; b=kvjs2WCzSpxEm2zESW5YD+q0F CzKdE4yll5H3tpmhimv/8k1nTYfzoVJP8soDoM4DAL36nupKFBWWrEewd7t11jUT0YMhWq2/aTJoX obnXnQwwH9EGlB+sWNvRe31oMTImiEwVwW8M268jpyJzBicEXfGpxW+Hr96INfzfvaYqC+rbfeMrm lYVMqhMqijRYk7Kn9rwwBmIIS3lcyluwgWGiSErEMsmGrp7zqBpbYeIMzw1JPMzgmuEopyugsHcxw CnQ3Nh5GjF2K34II3Mck1qgywCMzWAbcgPfVRLVNuJZmU1NQch+lWcSat79lr7FQug1USD4VYaRjg +g4GE+bqQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1hqeNQ-0000v9-21; Thu, 25 Jul 2019 14:05:48 +0000 Date: Thu, 25 Jul 2019 07:05:48 -0700 From: Christoph Hellwig To: "Andrew F. Davis" Cc: Christoph Hellwig , Laura Abbott , John Stultz , lkml , 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: <20190725140548.GB25010@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> <25353c4f-5389-0352-b34e-78698b35e588@redhat.com> <20190725124820.GC20286@infradead.org> <18975c1a-7e4e-fab3-eec8-387fbf9dcfe5@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <18975c1a-7e4e-fab3-eec8-387fbf9dcfe5@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:47:11AM -0400, Andrew F. Davis wrote: > This is a central allocator, it is not tied to any one device. If we > knew the one device ahead of time we would just use the existing dma_alloc. > > We might be able to solve some of that with late mapping after all the > devices attach to the buffer, but even then, which device's CMA area > would we chose to use from all the attached devices? > > I can agree that allocating from per-device CMA using Heaps doesn't make > much sense, but for global pools I'm not sure I see any way to allow > devices to select which pool is right for a specific use. They don't > have the full use-case information like the application does, the > selection needs to be made from the application. Well, the examples we had before was that we clear want to use the per-device CMA area. And at least in upstream a CMA area either is global or attached to a device, as we otherwise wouldn't find it.