Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9274030ybi; Wed, 24 Jul 2019 01:10:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqzR0+x1MHYpXxn+eS6E7wbTpxjY8zyVFsglPTP4P++wInmex41mH/Kl2uPXDQ44ruP4xQdd X-Received: by 2002:a63:5754:: with SMTP id h20mr40051997pgm.195.1563955817152; Wed, 24 Jul 2019 01:10:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563955817; cv=none; d=google.com; s=arc-20160816; b=xVy3NKOYuzuQZiDoluhuoFaYeAhv1cn0JwEPGmZPDZ/sm0hsS6Tix3teojwXwmLJmW fWYpi+Ur8AZ0VQ3wQSCSCr3d9btaXyQKvwfPOy4X5rhT5aoDHc0cqU5PNd+htDcpQquj gahPWpUiyE37W546Se07A3okIqOOr2bAzjKTWW/ET/naog8kZd9Su1uxUvpzM97sv5DV dGyUUiDfpj9Xs1hzOy4D0xd8szHKoEJFZmIppJ5w9mtv+x/Mm7rH7sVpWrD4bNe1hYT1 +ym3UEjbhCDrOSmIDtewfovfJm/abLI7D19dkjXMKIRUmBTuvP2yTPYFSnnYcTXq994S Za2Q== 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=9Lpd+hOfQ/hSysjd4WRfKNMZK+VOhGnP5t1TFXShC7M=; b=iVjrU66NPiVbmvfUxuWlUzJTRtB6G514aPWsrrqVFt5itVALyAq2E2LLgeHWQuyB7m fc+QqzO7Pe0WBHUrkNo3xiEWpHFWv+xFSsVjqGHV02RCe5XRBU/MKjw0DkJioafrjvGs Req6XEFGbiHcGwzTXXmbCpwGY7DUNqVYuUwNWuQqWhNuyBcGTGPRxRFEEonYeDi5X6KE C/27+1RFY+zyiJF7xUL0tkr5jdBJD9zAgQzua4qIduzLP3VnxEkV1gnmZOqOuEBBigkE mM5w23fCYp4u0rIAZNR5UDbtFgUTT6E72ue1dsQ4cgT0867bucPKi4/28pbFwpuGWRQ/ u1UQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VOQcbBOV; 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 t19si14406594pfe.94.2019.07.24.01.10.01; Wed, 24 Jul 2019 01:10:17 -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=VOQcbBOV; 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 S1726208AbfGXIJG (ORCPT + 99 others); Wed, 24 Jul 2019 04:09:06 -0400 Received: from mail-qt1-f195.google.com ([209.85.160.195]:39379 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725944AbfGXIJG (ORCPT ); Wed, 24 Jul 2019 04:09:06 -0400 Received: by mail-qt1-f195.google.com with SMTP id l9so44577357qtu.6 for ; Wed, 24 Jul 2019 01:09:06 -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=9Lpd+hOfQ/hSysjd4WRfKNMZK+VOhGnP5t1TFXShC7M=; b=VOQcbBOVW81gEk6UYdrISLr70kaZw7smJ93fG1k88v2CiADBQEGhOjdDrUVccAJ53f iis1zZNkYW8Ssai/XzSxFDoA/0X7+Xtv8H1HSftMVx+JHagoHr3iqjwcnloS+UJgjYdn vay/OWRz4LA3IZIIEnhiINZfTnCvMW358OdlNW0G0+UcvmfM3NY4LS3/RAbYpyi720/6 /I0JoRE9RTyoGAKJa3jmDAuPx/4YAOfqSsOYNMNtYNyhXqIR0HG6vt0XrzuFptZWqyTY HIb5bqcET3ZOyf+wJldrySHQcJOIxg4PPRWsNHswPosnAir5E6PMWMzbq0Jr7gLCAK4P /LYQ== 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=9Lpd+hOfQ/hSysjd4WRfKNMZK+VOhGnP5t1TFXShC7M=; b=TLyW8yCbL8plylQ6qO1s1CA+S+n92fxSlk8fZXZ7vwiCzNzJOhw0nYQkAGCgnHhYqm foNYspcWHBXqOpuW0rctr7Cj31x/gMV3UPLwGTzabj2PL2FVjHcNquo6TSdtiTVN3kW9 DRe452oUMAXQLyz7SQdeHBA29OFO+hlCseFjY5ErkxUfAp8bInUXA6F8jfLvnNAJ8BpS oi/RiMt4HCNqGid8VkI+b3irkB8VaTUIPrQCGdREYphblBJWmiaY5CkfjVqh1FQdD37B tS53qiCRSp5A530k1AmV3P8sOvnKNYsmeOn1tbbYJyHYAusUyaU9oyqBk4W1X/Q9QdxU 3jZw== X-Gm-Message-State: APjAAAXQ+zzlaL+d/hwE7TXFR3zLcO10FUs4dlCE/AYJLUHQDsxS3i+g 6393H7Dcr3x39U5sUj/mHLdjp3m/GsbuC2G+Ecvkiw== X-Received: by 2002:a0c:d003:: with SMTP id u3mr59212119qvg.112.1563955745710; Wed, 24 Jul 2019 01:09:05 -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> In-Reply-To: <20190724065958.GC16225@infradead.org> From: Benjamin Gaignard Date: Wed, 24 Jul 2019 10:08:54 +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 mer. 24 juil. 2019 =C3=A0 09:00, Christoph Hellwig a= =C3=A9crit : > > On Mon, Jul 22, 2019 at 10:04:06PM -0700, John Stultz wrote: > > Apologies, I'm not sure I'm understanding your suggestion here. > > dma_alloc_contiguous() does have some interesting optimizations > > (avoiding allocating single page from cma), though its focus on > > default area vs specific device area doesn't quite match up the usage > > model for dma heaps. Instead of allocating memory for a single > > device, we want to be able to allow userland, for a given usage mode, > > to be able to allocate a dmabuf from a specific heap of memory which > > will satisfy the usage mode for that buffer pipeline (across multiple > > devices). > > > > Now, indeed, the system and cma heaps in this patchset are a bit > > simple/trivial (though useful with my devices that require contiguous > > buffers for the display driver), but more complex ION heaps have > > traditionally stayed out of tree in vendor code, in many cases making > > incompatible tweaks to the ION core dmabuf exporter logic. > > So what would the more complicated heaps be? > > > That's why > > dmabuf heaps is trying to destage ION in a way that allows heaps to > > implement their exporter logic themselves, so we can start pulling > > those more complicated heaps out of their vendor hidey-holes and get > > some proper upstream review. > > > > But I suspect I just am confused as to what your suggesting. Maybe > > could you expand a bit? Apologies for being a bit dense. > > My suggestion is to merge the system and CMA heaps. CMA (at least > the system-wide CMA area) is really just an optimization to get > large contigous regions more easily. We should make use of it as > transparent as possible, just like we do in the DMA code. CMA has made possible to get large regions of memories and to give some priority on device allocating pages on it. I don't think that possible with system heap so I suggest to keep CMA heap if we want to be able to port a maximum of applications on dma-buf-heap. Benjamin