Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10966484ybi; Thu, 25 Jul 2019 07:48:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqyggmtzBkDtx2OspCJl6uGxK3KCQamcw2NBt46XgpN2WnmswnLhxU5Y5Ncxs50XGrac4pL2 X-Received: by 2002:a17:902:fe14:: with SMTP id g20mr86449022plj.54.1564066089187; Thu, 25 Jul 2019 07:48:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564066089; cv=none; d=google.com; s=arc-20160816; b=EcbdcKNkT4/6P+qHr+mK4gGPbMLnNjYZ4zFFmEVuUR2tHMqZ93AWTTyzJwnnSq1WM8 /k8F6D2PrApXKeEDSleA0oK4QPZ1ft1+vWpWkV7ekAuPD2ECenU+TjjutbH3P13PdwxH 9lrBo6Y8rp8lrGDhA97264as0jgVa+jeej3JFeGrjSXIG9gE2nu/OBTW/v+F7HHQdJGF IquO7EPCmHmPgBNes6iljxnYMAqkAqohPDv22PhKuCsSb5Y6cMBwe+gkesEDxPexD1vm v5ngRJ36EwA5V9mMIFOOGjRR4DPQC5k5VhGhGt1ikfpk5POtytUKyjoIdvdWg9Ue/DeB AYNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=EpauZog8AJ0JP+jM70fncJTKaBzMsaQ9j0djN38srWU=; b=b/X8Tsop8U04QH4/HlLNDSy9nFvLMST4Y7FRreFfsL/OnZ6gEWctyWRGOWCg+yYiPA aCXcqv7mygGLyhI3LA+VZin8wHwFSdfdvAE6ScCdhoJ3Bx97N8c+gVwOjQRCWvCh+8fT WHQ11pdNOX/PzuUay4cyr5TZafsZ1OhYbe9eW5/ObwkLzCOeQ2LrS+Vrjp+SzMfsaQe+ hjj0KjonYwVhtjgom9HszAWrePqdrgHQB66/JdzKc7Bdn9zQLcfYjxF4/JjPSHhhXE4u 5P95MyhyhvtauoL/1MEGz2vfeDzARHqb6Bc1KxdJ/3Yg0aBjrSYKZDIFXyQC9IKxadyI Twrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pCIkimKB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g5si18234087pgn.360.2019.07.25.07.47.53; Thu, 25 Jul 2019 07:48:09 -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=pass header.i=@linaro.org header.s=google header.b=pCIkimKB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388457AbfGYOrJ (ORCPT + 99 others); Thu, 25 Jul 2019 10:47:09 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:43727 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387804AbfGYOrJ (ORCPT ); Thu, 25 Jul 2019 10:47:09 -0400 Received: by mail-qk1-f193.google.com with SMTP id m14so10929178qka.10 for ; Thu, 25 Jul 2019 07:47:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=EpauZog8AJ0JP+jM70fncJTKaBzMsaQ9j0djN38srWU=; b=pCIkimKBBofK2niPxQMPIL9oHxljTwswpTmsaxh50VBjjkBbyvgmRXJbRQpo1kJ2Qs lYIInkn3OZFH5TqZbEoY4M3KTunf8bZ8GXSveSRJX05tGUmoRmVpex5DGoxKP0JMenRW fUnYIw+JZTP4ygsXVOc33k2DdcVOvVvQMoWcvSiAehbWRnO7m9bH+fbwpLApwYROvBWy DKvzMA0GRpwcqr7EbI3fXGHn5sdej8kz4a5eDRkAN94n6INYGjQwbNYhNQ3UB6U4cb7O 0BB/KYzB8tJT7HQs/Bo0pwr5oraUY2mY424OblaPNXFBLz5yHKy49xkkQI6414z5w/Q6 SOwQ== 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:content-transfer-encoding; bh=EpauZog8AJ0JP+jM70fncJTKaBzMsaQ9j0djN38srWU=; b=SBqnhq+iEipE49iCAXHSTtHtzK5rrf9YTSy8Umbi7nWYoQ+6XCFGik24+hgU63xCSn PGCQ/wTps/FKc+UE0gKE9hmJHWkNG6dtlVtJyaKwo4PbaNuGrQqMVnv/YqtXoRmpNzAe j8+hPxVCP66fNuU/tfng348k5P56puHez6x3Ww3wVvLIaOG4pM5cW7psMOPPPGVXfxaf /x8r31YT4HzcfxFqeo9VNvKoRbYPpZ0aKy3r0hZmZexkbiHjursfa+kLMU0uTZ2G075e 5ZCkoXmJvhUR2cVzWbvIIK6x9jS1DcOctbhhOElLpGwxywr2a3U6y24rNiYRp/Wx5Pe7 7nrw== X-Gm-Message-State: APjAAAVrh7yr5JyBNVryhB1eTHYhjE5AEE9BKPgRloZmmDPBIHWaQi9v bv2PF9c2ZhX46tCgJGKBrBW20VObbUUaXA6t1VhJ7w== X-Received: by 2002:a05:620a:1286:: with SMTP id w6mr57362371qki.219.1564066028230; Thu, 25 Jul 2019 07:47:08 -0700 (PDT) MIME-Version: 1.0 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> <20190725143335.GB21894@infradead.org> In-Reply-To: <20190725143335.GB21894@infradead.org> From: Benjamin Gaignard Date: Thu, 25 Jul 2019 16:46:55 +0200 Message-ID: Subject: Re: [PATCH v6 4/5] dma-buf: heaps: Add CMA heap to dmabuf heaps To: Christoph Hellwig Cc: 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le jeu. 25 juil. 2019 =C3=A0 16:33, Christoph Hellwig a= =C3=A9crit : > > 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 =3D 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. Form my point of view default cma area is a specific allocator because it could migrate page to give them in priority to contigous allocation. It = is also one of the last region where system page are going to be allocated. I don't think that system allocator does have the same features, either we would have use it rather develop CMA years ago ;-). In short CMA had solved lot of problems on our side so it had to have it own heap.