Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9466753ybi; Wed, 24 Jul 2019 04:39:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqwbNnhio871AArB+VerSq6VDlfHtlux/kAan4ZG1pDh6YmLBwez84iyloe5qkgXky0GCcwX X-Received: by 2002:a17:90a:2385:: with SMTP id g5mr89211227pje.12.1563968353836; Wed, 24 Jul 2019 04:39:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563968353; cv=none; d=google.com; s=arc-20160816; b=sos2CSxv+SyFYIkcrHDRI2tWwYXTn1eVYiKubmGqIlncxTzHHbX34HY//r20zurrU/ oYK9hYmoE9wSaVGlDxzjYZQyurADBWeTijHE2sZn+cURrsqnSkO6W2sI4oE6a9t1+ZCP EiwR3kSuw733XQ0PbDcdFqflrc82EBc8tEcv03HYLaXmVL0l/8BAy5d9j975Td9lmEKA gRcXpc5up5TxrJzR8N+KU+zV1gk40ej6TKF5q8ZaJBOzQ2frFRBQaMQBMrh0PTgHgTx2 vGgkPkwHE3OneCjARTNurFKx7MxlJAVhnpmtPXNzPiXbUVn84+L05qVZkAJDlkVvTyud uj4Q== 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=OtXsM3EAnHCwOTu8jwk53eaCILY4JLC/RpCVWDNAsAc=; b=cqb6jgMs/r0EDcgm/hXwwvSM+w8RTtmMcMT5ua/TvMP+RwTzQtLGMHYtxRFu4QHbh6 OQ3ya15N9dZz9evhIEFZ3g7GuTwM4cbW7ObH07hDHoh1oPDDwOIJRXbB5ZnN37t4o3e1 H+iwOZemMEo7tR/jK7Fa7bGyv228MhMGQcaSXFDMGpZoXANmkbZSvfijGfx2GIRJgVW1 9hNZYtckGXLrPQVDyEdCECy74V7746LVnK8bdECn9xOfMKtdB1WPg251u7YhSEThjRmq elHwS37FbQ+llztq1LZIAry+IY6LEV951srrCVuurx8EZfYaKce42t+ixzXW3jj8WMMp IKTw== 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 k13si14033179pgj.525.2019.07.24.04.38.59; Wed, 24 Jul 2019 04:39:13 -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 S1727573AbfGXLiK (ORCPT + 99 others); Wed, 24 Jul 2019 07:38:10 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:43909 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727482AbfGXLiJ (ORCPT ); Wed, 24 Jul 2019 07:38:09 -0400 Received: by mail-qt1-f196.google.com with SMTP id w17so768345qto.10 for ; Wed, 24 Jul 2019 04:38:09 -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=OtXsM3EAnHCwOTu8jwk53eaCILY4JLC/RpCVWDNAsAc=; b=e6ENeNoDTjvOwJp34C/A8zpVfqnUuOinnCCRFDcDgkm/vMMsfYhJalVdnH3Mzv2nsC od7xR3EIMPMamLeTDs9NLMYKwAWfyuSEgvr5oy0wqbmGl2zSR6fcmT5KUpBoAAm6sx1O mAuYen2cyu9nl1l8mNXu2DjxHIvhPNOTnR5ypP0O/LrwYj/cF5xTEeWww3bM8hiBkk4T wURyK1dTnQYt94G+EAvttP6N9kJBGRDSITFHmzdsv5gwePyPuTJnn6Xmg9vwZ1KWjXDJ TAywjMJp1XJh83Udy1jZOpHZ9YjFH6Ly90z4HzcQsKvgLoT8dVHXVOGhA/+5l/hBi8Vd oaiQ== X-Gm-Message-State: APjAAAVWnbTwRLhzYy01nWpel+nUFoX+py8QwXiI8p7eIMxsLZFyO1LA 02GOVtQfeyIWEk2+dD6H0rllqg== X-Received: by 2002:ac8:2409:: with SMTP id c9mr57284445qtc.145.1563968288928; Wed, 24 Jul 2019 04:38:08 -0700 (PDT) Received: from [192.168.1.157] (pool-96-235-39-235.pitbpa.fios.verizon.net. [96.235.39.235]) by smtp.gmail.com with ESMTPSA id 42sm24549812qtm.27.2019.07.24.04.38.07 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jul 2019 04:38:08 -0700 (PDT) Subject: Re: [PATCH v6 4/5] dma-buf: heaps: Add CMA heap to dmabuf heaps To: Christoph Hellwig , John Stultz Cc: lkml , Benjamin Gaignard , 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 References: <20190624194908.121273-1-john.stultz@linaro.org> <20190624194908.121273-5-john.stultz@linaro.org> <20190718100840.GB19666@infradead.org> <20190724065958.GC16225@infradead.org> From: Laura Abbott Message-ID: <25353c4f-5389-0352-b34e-78698b35e588@redhat.com> Date: Wed, 24 Jul 2019 07:38:07 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20190724065958.GC16225@infradead.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 7/24/19 2:59 AM, Christoph Hellwig wrote: > 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. > It's not just an optimization for Ion though. Ion was designed to let the callers choose between system and multiple CMA heaps. On other systems there may be multiple CMA regions dedicated to a specific purpose or placed at a specific address. The callers need to be able to choose exactly whether they want a particular CMA region or discontiguous regions. Thanks, Laura