Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10942303ybi; Thu, 25 Jul 2019 07:24:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqwgT8TfTUkMS54O8FQwajA38DMH7lljE1eprgSSYoxclsfUxiaANnE1dlH+MA60cnXHxvCP X-Received: by 2002:a65:4b89:: with SMTP id t9mr17520917pgq.55.1564064647664; Thu, 25 Jul 2019 07:24:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564064647; cv=none; d=google.com; s=arc-20160816; b=NiOgio27kpy4gpfKmYmG6bt+qTtZ016JQVexD+R3h6K25n7L6rS668oZ3SGEaPJyjn UDRgNuvVNkMvnX5rGROJMy7q24IKuezknDHN6SKswCXR25zAIWlOH0ZHZ6edjHDf5kVj Byjpqrzzfs5EN/QrJeUMfXIlWOmvQLMGKuINgZWw51FqiUNXFL3vEIeGMfr3/Oz+kHYI 4mKNOYsAEpdHvsTXZJ6YZ/JHDnm0BkaGnp+AoHkwVbFqkzUJzj+PMG1CGVef9f+oe/8B pD+Q2tujpRzgwNPmAhPYHPVOcN8evynnA2mui2cwR/XKY68AW/TIJ/eCdkhyIjA5asTW 5ctw== 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:dkim-signature; bh=w+T9dlJYQaD9FfO7esnlLeCqS7R5uSui0ZKYuPaxp58=; b=oazsE9xstkNsxtJUiueJVomn71meowRl2Lz6+3QVEaBAc9zfUOQ5XQ1n2xE9sL9s7G JMIURt17+gN26ejezpuYRgzXRuBoDqcbZqpSqvHa5jHLQH9VBUid8iNvJjdM4nMeQ3G0 tHEDu4uJ912KV9gFBw2Qxj3XaI6h/DipF5HrOvvkmKwx5JL6O9ljzWf1qdfsSyWKU/zk MjLwPiwbvlaH3AGaF8kjs6Ge7mT9V2AvAN449hf7HJ9/xb6uS/usnC1mpoDFv9yZZpu6 aB0vJsflad0sJpE9Lds8yBEP22tnUE2vNTeVo1U8wg3w8hJximyZAues/Trq+Z947WWX /WQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=uGcHOF0Y; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w12si16747054plq.92.2019.07.25.07.23.52; Thu, 25 Jul 2019 07:24:07 -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=@ti.com header.s=ti-com-17Q1 header.b=uGcHOF0Y; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390529AbfGYNrp (ORCPT + 99 others); Thu, 25 Jul 2019 09:47:45 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:53422 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390490AbfGYNrk (ORCPT ); Thu, 25 Jul 2019 09:47:40 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x6PDlCSU120551; Thu, 25 Jul 2019 08:47:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1564062432; bh=w+T9dlJYQaD9FfO7esnlLeCqS7R5uSui0ZKYuPaxp58=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=uGcHOF0YgoXt79Yfr7hLsqm1JY3HTVLxjgkOILT/UaHSLWFV3ZaSmTVWbJziwnDRc BMagzBiPV3eu0wESHj12ybXkPTZuyJwm+5ZdPgibV9ewt0aPzmLYDA8uzTe1ZxzFuK 1IwKDp01j1CbNfwK/+VJr6dVH6ehHecyGvmXWmaM= Received: from DFLE109.ent.ti.com (dfle109.ent.ti.com [10.64.6.30]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x6PDlCMr050293 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 25 Jul 2019 08:47:12 -0500 Received: from DFLE115.ent.ti.com (10.64.6.36) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Thu, 25 Jul 2019 08:47:12 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE115.ent.ti.com (10.64.6.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Thu, 25 Jul 2019 08:47:12 -0500 Received: from [10.250.86.29] (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id x6PDlBud103612; Thu, 25 Jul 2019 08:47:11 -0500 Subject: Re: [PATCH v6 4/5] dma-buf: heaps: Add CMA heap to dmabuf heaps To: Christoph Hellwig , Laura Abbott CC: John Stultz , lkml , Benjamin Gaignard , Sumit Semwal , Liam Mark , Pratik Patel , Brian Starkey , Vincent Donnefort , Sudipto Paul , 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> <25353c4f-5389-0352-b34e-78698b35e588@redhat.com> <20190725124820.GC20286@infradead.org> From: "Andrew F. Davis" Message-ID: <18975c1a-7e4e-fab3-eec8-387fbf9dcfe5@ti.com> Date: Thu, 25 Jul 2019 09:47:11 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190725124820.GC20286@infradead.org> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/25/19 8:48 AM, Christoph Hellwig wrote: > On Wed, Jul 24, 2019 at 07:38:07AM -0400, Laura Abbott wrote: >> It's not just an optimization for Ion though. Ion was designed to >> let the callers choose between system and multiple CMA heaps. > > Who cares about ion? That some out of tree android crap that should > not be relevant for upstream except as an example for how not to design > things.. > Tell us how you really feel about ION :) >> 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. > > At least in cma is only used either with the global pool or a per-device > cma pool. I think if you want to make this new dma-buf API fit in with > the rest with the kernel you follow that model, and pass in a struct > device to select the particular cma area, similar how the DMA allocator > works. > This is a central allocator, it is not tied to any one device. If we knew the one device ahead of time we would just use the existing dma_alloc. We might be able to solve some of that with late mapping after all the devices attach to the buffer, but even then, which device's CMA area would we chose to use from all the attached devices? I can agree that allocating from per-device CMA using Heaps doesn't make much sense, but for global pools I'm not sure I see any way to allow devices to select which pool is right for a specific use. They don't have the full use-case information like the application does, the selection needs to be made from the application. Andrew