From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3957BC61DD8 for ; Fri, 30 Oct 2020 08:24:09 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4386222265 for ; Fri, 30 Oct 2020 08:24:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4386222265 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sina.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 413846E999; Fri, 30 Oct 2020 08:23:21 +0000 (UTC) Received: from r3-19.sinamail.sina.com.cn (r3-19.sinamail.sina.com.cn [202.108.3.19]) by gabe.freedesktop.org (Postfix) with SMTP id EDB1C6E961 for ; Fri, 30 Oct 2020 07:53:00 +0000 (UTC) Received: from unknown (HELO localhost.localdomain)([103.193.190.174]) by sina.com with ESMTP id 5F9BC5C700035BBA; Fri, 30 Oct 2020 15:50:33 +0800 (CST) X-Sender: hdanton@sina.com X-Auth-ID: hdanton@sina.com X-SMAIL-MID: 18572715073642 From: Hillf Danton To: John Stultz Subject: Re: [PATCH v4 7/7] dma-buf: system_heap: Add a system-uncached heap re-using the system heap Date: Fri, 30 Oct 2020 15:50:23 +0800 Message-Id: <20201030075023.3250-1-hdanton@sina.com> MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 30 Oct 2020 08:23:17 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: James Jones , Robin Murphy , Liam Mark , lkml , Christoph Hellwig , dri-devel , Ezequiel Garcia , linux-media Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Thu, 29 Oct 2020 21:04:30 -0700 John Stultz wrote: > > But I'll try to share my thoughts: > > So the system heap allows for allocation of non-contiguous buffers > (currently allocated from page_alloc), which we keep track using > sglists. > Since the resulting dmabufs are shared between multiple devices, we > want to provide a *specific type of memory* (in this case > non-contiguous system memory), rather than what the underlying > dma_alloc_attr() allocates for a specific device. If the memory slice(just a page for simple case) from dma_alloc_attr(for device-A) does not work for device-B, nor can page_alloc do the job imho. > > My sense is dma_mmap_wc() likely ought to be paired with switching to > using dma_alloc_wc() as well, which calls down to dma_alloc_attr(). > Maybe one could use dma_alloc_attr against the heap device to allocate > chunks that we track in the sglist. But I'm not sure how that saves us > much other than possibly swapping dma_mmap_wc() for remap_pfn_range()? _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel