Received: by 2002:ac0:950e:0:0:0:0:0 with SMTP id f14csp9150imc; Fri, 15 Mar 2019 13:35:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqyFZ62rCKEds2Vi6vk2C9KTb1mCNKn0yRMMhxZ0PukU1QXVx+Xb4xPC8hX2ACC0K+L/AEIF X-Received: by 2002:a17:902:7202:: with SMTP id ba2mr6111861plb.147.1552682134528; Fri, 15 Mar 2019 13:35:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552682134; cv=none; d=google.com; s=arc-20160816; b=orGBGy8w/UbA3Kl3dV1tqDWymJV8zBJg06QimCq6f2S4xUt5KdtLw7z3UQU7e08Dsp Sc28htGaz0Xqvv2/DGv1DAp5UN6ZCQMO+IJG3EumZjafi7RjjWBCqx0JY1m48KUZtFAk W/SQzqeYX7Mbw5RfWqhNR846GMuVnm92q32BRjb6E7Tqc3gS3Rv3JdwOC6kBtsZFziQ5 43W84iffl7Z3HX2KI60JsnWvTVIxHn6x+MbdlbQUdtdAFNfCZNq9qa/px/SPtxp1Q84g pUlnbyJS7DR1CNaVXuZqAHqy9q4VnHrqnBZvc8e9waejkYKtg/nM+zZaplPPuhrEnR6J S9Qw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=a81qls6bJh24LQhM0wIk0kx+M01dPo44WFCFvWenQTo=; b=S/bAIV5UnQO1iQcy/4sR5K0TNLSVYDsmTqhhihKkAiJW5JM4zOY1tKPk7JUdOrvoNr HHGwm7LEEK17MYGuZjGzDv108TlIbaDpWstBZ3F3qK0Qc3swUalEBQMsc+osN6F3bDu1 LX2dG5IRVMlNR3ZC/Ox7GA34CAJsmmRwyRGAy/Bxadlxr6Hq7E8vuuZ5uWPZJdxudUbv u2UidAtEIJ84S79jIzzN25LlEVLs2qUe8f9EPQcBWUAX06JeOwOUnLxnj64rxEeQAfg+ jeExUl985EM5megNzP+okBiUFUWS2wj5cGffRy5vEom/8E/UnjR2p6dlNryoCLPHxKKc zC2g== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g90si2773027plb.51.2019.03.15.13.35.18; Fri, 15 Mar 2019 13:35:34 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726549AbfCOUeg (ORCPT + 99 others); Fri, 15 Mar 2019 16:34:36 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:43479 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726097AbfCOUeg (ORCPT ); Fri, 15 Mar 2019 16:34:36 -0400 Received: by mail-qk1-f194.google.com with SMTP id c20so1559414qkc.10 for ; Fri, 15 Mar 2019 13:34:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=a81qls6bJh24LQhM0wIk0kx+M01dPo44WFCFvWenQTo=; b=CgdM081Geoe34HLUbwpYQoz0wP+sn02/vbJ7Wo4tGpvyX3XBu4EoGDXzwPxxAYjGTL 2CTVix7kfVCDVIBxPU4bg+FCKxRtLUw/nprlFs7XcUOCnh/lBdu8iwSCILReyOJc+1wR jU5UXq2ORFijOWMcGWpV91e890yZjiUXYDOHh0pHoPchm7DPbqeP/ApvK4ACB4dlOtCA x0iUYe1C/2I89hOKSMmYD1HGUl1LHp4JneVLdV9bGIeZnQWfn+1tCBRuzGjqz04/7hA5 Yl3vPE5HL2z1eoHDnOp0cwyIcvdN74gWB0Ws7XHqWRAZfn4+WHkWef1dEmjO9Q+c3L0D Q7SA== X-Gm-Message-State: APjAAAVpAt5otOhaxPBjU0EhOSolXpYCxKLdg9l+Aa35OIEjwEg54yw5 cMB9fUo+bGOoQn4pF0TUjxaymg== X-Received: by 2002:a05:620a:159b:: with SMTP id d27mr4397424qkk.163.1552682074949; Fri, 15 Mar 2019 13:34:34 -0700 (PDT) Received: from ?IPv6:2601:602:9800:dae6::362? ([2601:602:9800:dae6::362]) by smtp.gmail.com with ESMTPSA id g123sm4750826qkg.0.2019.03.15.13.34.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Mar 2019 13:34:34 -0700 (PDT) Subject: Re: [RFC][PATCH 0/5 v2] DMA-BUF Heaps (destaging ION) To: John Stultz , lkml Cc: Benjamin Gaignard , Greg KH , Sumit Semwal , Liam Mark , Brian Starkey , "Andrew F . Davis" , Chenbo Feng , Alistair Strachan , dri-devel@lists.freedesktop.org References: <1551819273-640-1-git-send-email-john.stultz@linaro.org> From: Laura Abbott Message-ID: <6c164c47-885f-b856-9d5d-74df9459d862@redhat.com> Date: Fri, 15 Mar 2019 13:34:32 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <1551819273-640-1-git-send-email-john.stultz@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/5/19 12:54 PM, John Stultz wrote: > Here is a initial RFC of the dma-buf heaps patchset Andrew and I > have been working on which tries to destage a fair chunk of ION > functionality. > > The patchset implements per-heap devices which can be opened > directly and then an ioctl is used to allocate a dmabuf from the > heap. > > The interface is similar, but much simpler then IONs, only > providing an ALLOC ioctl. > > Also, I've provided simple system and cma heaps. The system > heap in particular is missing the page-pool optimizations ION > had, but works well enough to validate the interface. > > I've booted and tested these patches with AOSP on the HiKey960 > using the kernel tree here: > https://git.linaro.org/people/john.stultz/android-dev.git/log/?h=dev/dma-buf-heap > > And the userspace changes here: > https://android-review.googlesource.com/c/device/linaro/hikey/+/909436 > > > Compared to ION, this patchset is missing the system-contig, > carveout and chunk heaps, as I don't have a device that uses > those, so I'm unable to do much useful validation there. > Additionally we have no upstream users of chunk or carveout, > and the system-contig has been deprecated in the common/andoid-* > kernels, so this should be ok. > > I've also removed the stats accounting for now, since it should > be implemented by the heaps themselves. > > Eventual TODOS: > * Reimplement page-pool for system heap (working on this) > * Add stats accounting to system/cma heaps > * Make the kselftest actually useful > * Add other heaps folks see as useful (would love to get > some help from actual carveout/chunk users)! > > That said, the main user-interface is shaping up and I wanted > to get some input on the device model (particularly from GreKH) > and any other API/ABI specific input. > > thanks > -john > > Cc: Laura Abbott > Cc: Benjamin Gaignard > Cc: Greg KH > Cc: Sumit Semwal > Cc: Liam Mark > Cc: Brian Starkey > Cc: Andrew F. Davis > Cc: Chenbo Feng > Cc: Alistair Strachan > Cc: dri-devel@lists.freedesktop.org > > Andrew F. Davis (1): > dma-buf: Add dma-buf heaps framework > > John Stultz (4): > dma-buf: heaps: Add heap helpers > dma-buf: heaps: Add system heap to dmabuf heaps > dma-buf: heaps: Add CMA heap to dmabuf heapss > kselftests: Add dma-heap test > > MAINTAINERS | 16 + > drivers/dma-buf/Kconfig | 10 + > drivers/dma-buf/Makefile | 2 + > drivers/dma-buf/dma-heap.c | 191 ++++++++++++ > drivers/dma-buf/heaps/Kconfig | 14 + > drivers/dma-buf/heaps/Makefile | 4 + > drivers/dma-buf/heaps/cma_heap.c | 164 ++++++++++ > drivers/dma-buf/heaps/heap-helpers.c | 335 +++++++++++++++++++++ > drivers/dma-buf/heaps/heap-helpers.h | 48 +++ > drivers/dma-buf/heaps/system_heap.c | 132 ++++++++ > include/linux/dma-heap.h | 65 ++++ > include/uapi/linux/dma-heap.h | 52 ++++ > tools/testing/selftests/dmabuf-heaps/Makefile | 11 + > tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c | 96 ++++++ > 14 files changed, 1140 insertions(+) > create mode 100644 drivers/dma-buf/dma-heap.c > create mode 100644 drivers/dma-buf/heaps/Kconfig > create mode 100644 drivers/dma-buf/heaps/Makefile > create mode 100644 drivers/dma-buf/heaps/cma_heap.c > create mode 100644 drivers/dma-buf/heaps/heap-helpers.c > create mode 100644 drivers/dma-buf/heaps/heap-helpers.h > create mode 100644 drivers/dma-buf/heaps/system_heap.c > create mode 100644 include/linux/dma-heap.h > create mode 100644 include/uapi/linux/dma-heap.h > create mode 100644 tools/testing/selftests/dmabuf-heaps/Makefile > create mode 100644 tools/testing/selftests/dmabuf-heaps/dmabuf-heap.c > This is looking really great. Thanks for doing the work to push this forward. It seems like we're in general agreement about much of this. Which of the issues that have come up do you think are a "hard no" to keeping this from going in? Thanks, Laura