Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10936979ybi; Thu, 25 Jul 2019 07:19:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqxbQ5eeEGi46JjRqeWzemgM7k229i6cQT+8c9McOHBXs3NFILNm8S9q0KtIqKtS5mr1Kf2i X-Received: by 2002:aa7:940c:: with SMTP id x12mr17214250pfo.80.1564064362528; Thu, 25 Jul 2019 07:19:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564064362; cv=none; d=google.com; s=arc-20160816; b=Aw3Xev0/yivD1bddkCGm0SsQRvJcYqQ48RwD4ydF/XW2JrEpdjOY3RY3ol5wB+3fd2 XbhsE2pAyzF3dOh/VWwLKyVyYWFp+7QHai6djtxy6UJWbvBkMjRaoHs0I81JiXDbxt7L trHImUxYHi94aU0ExAuTPI/VKLJtX91QawP9PrN+2hAZo0kI7KyorPQAOrytpVyMQjzo xz+jEu7upQhl8YhLj43IqIghLJcVozLO+6d1B24jc882BfQA09e6UhGUDOfaPsnHeg8T Rv/2q343e3yaVLx1smbq+zSzBvHtIhl68WX8xG24IBBCTk4e1fhby3lk52a8u40cePV3 Xjlw== 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=B/ntLJ2e1bIKShYP2qLtMwAe3jOvq47HHoEw6r4s2ZA=; b=MfAH68C7bashmf8d9QFBdzutw/PBqe8GMk6eLcaxQRCMEb3HpuG451VTpj5bFxnPjr gfPVd3vuy3Utw/hKWUdJrPAXnR5bF+zjwMll+I26A9w2jsWi2/v1l7b2BujgpVUMzGRS 5rpTsnfg7PeEZ1cXs1RW+lXaqNFrF7OA7lMiVUV9i5RneMhesLwbwu4BSLb1jUJoV99y fK3qSn3DtjkcNFrGR1OrR0OiMB0YMwwLVUGm6coPMjTSfl3sjzvb6asTLXu6xMA6ti/U lZtaS/W9MMaLABx7Ev3Xot46KHilRWTiHGtSGma5Q0WJdV/SRoj8KuDs3jw7Ys6rLI1/ pPGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Ip6hXMPL; 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 l10si20417298pgp.411.2019.07.25.07.19.03; Thu, 25 Jul 2019 07:19:22 -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=Ip6hXMPL; 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 S2387852AbfGYNcU (ORCPT + 99 others); Thu, 25 Jul 2019 09:32:20 -0400 Received: from fllv0015.ext.ti.com ([198.47.19.141]:50898 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387632AbfGYNcU (ORCPT ); Thu, 25 Jul 2019 09:32:20 -0400 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x6PDVqIt074564; Thu, 25 Jul 2019 08:31:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1564061512; bh=B/ntLJ2e1bIKShYP2qLtMwAe3jOvq47HHoEw6r4s2ZA=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=Ip6hXMPL4GiG/YNz0lIukcvAkp/BqHTNVXLtqtwTWZvDh3xsO4c9kteivrfZmAiEB QUzcDPwqZj9HSlvBM+ZyC7PovEIcxAsqzqfVowgMbmbsJACjBO4EdlBZa5c257g+EK vbtBslAD/tq6XsA/Cjk9N9zv7D04+VmLjp19dKT0= Received: from DFLE111.ent.ti.com (dfle111.ent.ti.com [10.64.6.32]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x6PDVql1073481 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 25 Jul 2019 08:31:52 -0500 Received: from DFLE114.ent.ti.com (10.64.6.35) by DFLE111.ent.ti.com (10.64.6.32) 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:31:51 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE114.ent.ti.com (10.64.6.35) 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:31:51 -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 x6PDVo6N082317; Thu, 25 Jul 2019 08:31:50 -0500 Subject: Re: [PATCH v6 4/5] dma-buf: heaps: Add CMA heap to dmabuf heaps To: Christoph Hellwig CC: John Stultz , lkml , Laura Abbott , 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> <8e6f8e4f-20fc-1f1f-2228-f4fd7c7c5c1f@ti.com> <20190725125014.GD20286@infradead.org> From: "Andrew F. Davis" Message-ID: <0eae0024-1fdf-bd06-a8ff-1a41f0af3c69@ti.com> Date: Thu, 25 Jul 2019 09:31:50 -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: <20190725125014.GD20286@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:50 AM, Christoph Hellwig wrote: > On Wed, Jul 24, 2019 at 11:46:01AM -0400, Andrew F. Davis wrote: >> https://patchwork.kernel.org/patch/10863957/ >> >> It's actually a more simple heap type IMHO, but the logic inside is >> incompatible with the system/CMA heaps, if you move any of their code >> into the core framework then this heap stops working. Leading to out of >> tree hacks on the core to get it back functional. I see the same for the >> "complex" heaps with ION. > > Well, this mostly is just another allocator (gen_pool). And given that > the whole dma-buf infrastucture assumes things are backed by pages we > really shouldn't need much more than an alloc and a free callback (and > maybe the pgprot to map it) and handle the rest in common code. > But that's just it, dma-buf does not assume buffers are backed by normal kernel managed memory, it is up to the buffer exporter where and when to allocate the memory. The memory backed by this SRAM buffer does not have the normal struct page backing. So moving the map, sync, etc functions to common code would fail for this and many other heap types. This was a major problem with Ion that prompted this new design. Each heap type may need to do something different depending on its backing memory, moving everything to common code that is common to System and CMA heaps is would lead those being the only upstreamable heaps. Andrew