Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp11158869ybi; Thu, 25 Jul 2019 11:01:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqwdVXUEVCfuIHU6tTrp0SMCPRUWjw58UTCzfJjAiHePXVi9lALB39u0c+k3F/ukaYNzow+6 X-Received: by 2002:a17:902:7612:: with SMTP id k18mr91007269pll.48.1564077690174; Thu, 25 Jul 2019 11:01:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564077690; cv=none; d=google.com; s=arc-20160816; b=vD5UPS4d7mpdLFnmbLzF9dSW53fzHotJLHAn9Ku4uAsV8jepzfhSSSE6TsHO+c9S93 w0Mp6l5YdE8rzuU1hAxUY4oSra1KYleX4Hmdkc+4473XF2t+UTQPyhHERVUgN5cBt+Lm VK+xiFAy+1SeqM9jWH5sWfVcLnMc8C8dM8HkvcODxUtZE55oF/1lSPUjAJtqqpSGm1Fn tXPBhF5Qht3eR8pL7lWFCVNZoLSRzGkI0r8nI3UuWkyT5q1HSINtbdgeLL7jY0G/+Vfw pqcvBDddAgGIG0nF7YWnLy0hBwRlpQs3tvvHVB8bDe1mb5BT2OQnbGs2CLz/P8CQCibG leOA== 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=FZTjzooOQfdeIEKO6c7B0Q4Q39gStipSBPssv7rm1tw=; b=UBbaqKHTzgIpcHel98YXZPflt29LV0K/y7VjDwwbHhInbzFYreMTvKamMYxlF85hY3 UlloP0NdJ1Rz9cA+FtDJLdBkpeml7Eupp73m+EDM/oROrqWX+DjzGcps9keb7wm9r900 xsnQrZ4iZXx3TFW68lnkVIh4DLmctDSjRat/ISBlrKBot0kz16ThS88DcjeNs9OUAuFd wPT4mOtokRX08ye24UnlAko8YwNOtdgjWnmFbdLwzESs4aaum1J8j3sNpX2P1+A3U6LE QX/SDnT2k38Pyxamr1CzilDWBoM0hFm1rLbes5ZqcPxod7jI5Aji4KWBC4kn7LbrlFOx j5zQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=rSl543HC; 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 n6si22953350pgs.333.2019.07.25.11.01.14; Thu, 25 Jul 2019 11:01:30 -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=rSl543HC; 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 S1728794AbfGYOdg (ORCPT + 99 others); Thu, 25 Jul 2019 10:33:36 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:48110 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728721AbfGYOdg (ORCPT ); Thu, 25 Jul 2019 10:33:36 -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=FZTjzooOQfdeIEKO6c7B0Q4Q39gStipSBPssv7rm1tw=; b=rSl543HC94I1WsxY4q6FwLykM uOt0SEphra34W1vaXTw3cZj8K11hmmQm3EOjFcHVE0km8+dsyHdZcfjUHJJkT3SESQd5HnU5Gv+Kb EgF31ARnFL3BQj1MBaJN59M5cJsLEqt5UNo2ei0djAiRo9Njkz0V5WzY6AuoRvk8R7nhQLxIRRlfU L2JZkVs3KlmswNFZsUwtSA2r6+Mqgo4+B9CWjJP+LN62CiR8dGT6wB7Z9ck5gKdSgX7wmQSta54AG 8CWAptGhRQb0mfSCmnwGGe1jFrbSY/GlKRccFxKYAM6LczHExn5FrNaFPlc9aenfYk339k/PjJvBB 9TScD2FzA==; Received: from hch by bombadil.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1hqeoJ-0007gg-VX; Thu, 25 Jul 2019 14:33:35 +0000 Date: Thu, 25 Jul 2019 07:33:35 -0700 From: Christoph Hellwig To: Benjamin Gaignard Cc: Christoph Hellwig , John Stultz , lkml , Laura Abbott , Sumit Semwal , Liam Mark , Pratik Patel , Brian Starkey , Vincent Donnefort , Sudipto Paul , "Andrew F . Davis" , 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: <20190725143335.GB21894@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> <20190725125206.GE20286@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 03:20:11PM +0200, Benjamin Gaignard wrote: > > But that just means we need a flag that memory needs to be contiguous, > > which totally makes sense at the API level. But CMA is not the only > > source of contigous memory, so we should not conflate the two. > > We have one file descriptor per heap to be able to add access control > on each heap. > That wasn't possible with ION because the heap was selected given the > flags in ioctl > structure and we can't do access control based on that. If we put flag > to select the > allocation mechanism (system, CMA, other) in ioctl we come back to ION status. > For me one allocation mechanism = one heap. Well, I agree with your split for different fundamentally different allocators. But the point is that CMA (at least the system cma area) fundamentally isn't a different allocator. The per-device CMA area still are kinda the same, but you can just have one fd for each per-device CMA area to make your life simple.