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=-5.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 41134C64E7A for ; Tue, 1 Dec 2020 23:38:30 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 7EC352225A for ; Tue, 1 Dec 2020 23:38:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7EC352225A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 89AB16B0068; Tue, 1 Dec 2020 18:38:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 871F48D0003; Tue, 1 Dec 2020 18:38:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7888E8D0001; Tue, 1 Dec 2020 18:38:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0137.hostedemail.com [216.40.44.137]) by kanga.kvack.org (Postfix) with ESMTP id 5E0646B0068 for ; Tue, 1 Dec 2020 18:38:28 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 222F81EF3 for ; Tue, 1 Dec 2020 23:38:28 +0000 (UTC) X-FDA: 77546329896.11.stamp23_0602245273ae Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin11.hostedemail.com (Postfix) with ESMTP id F0922180F8B82 for ; Tue, 1 Dec 2020 23:38:27 +0000 (UTC) X-HE-Tag: stamp23_0602245273ae X-Filterd-Recvd-Size: 5186 Received: from mail-ot1-f66.google.com (mail-ot1-f66.google.com [209.85.210.66]) by imf05.hostedemail.com (Postfix) with ESMTP for ; Tue, 1 Dec 2020 23:38:27 +0000 (UTC) Received: by mail-ot1-f66.google.com with SMTP id f12so3436756oto.10 for ; Tue, 01 Dec 2020 15:38:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AcUljttS1/Kv9szBrro01vh8YqqJASGgC7Alt3BmlWo=; b=CyOy3yOcWwb512J6zbdkSYqy0VmZT8LjbKvW5Ky+B3G9Z7qUsmCHoGpbA7yV3cUOjs ip2Oy1mvs3e72TrbAVkqZqwnrCQzLpybnu0i+q/GSgEpZfuqNu2sVHUqKOvwkgar/PBj 1ZN0M8jT/41HGZ+A72nYrBwgA+LlOlis+FtY8ssnKqPHb6uJ3qDr5BwMOtmf2bwA6+6k dv/i1SRkl7IM+qxg3BUtn32XMZ8MZaeNnDEMPaLMKyPzTL+LhJ9LwoHLRvK5Ei8VMerb /YyXsuqWwkuud/IDiJpGaq7nDUutOqhJsHgHuXRl0o/7TUKs00JD7vth9PRfzWEYWCkC XcAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AcUljttS1/Kv9szBrro01vh8YqqJASGgC7Alt3BmlWo=; b=UEfJsd8a9gKFF2X/OQEqVBTfJBYxh3oVj+QX5X2awmdqf788R+wopfosXh+Q5Bb6nE uqPUrnZRzgcl5F1wYVoD86no7ufdSaFiChBngtt0on2zhY2BdruTv/gxRweGOBXUoXw1 ZqUd58U+8TJ+hsk5rtzSt9GdoJ8UW7NnX6Bh5u4qcxS7k9ahDf4k+UYYoOqz7kCbPNQZ RVCVnZ6oNHc1dSKcBAwPnDAl6LalcRiERYEQN7Vk1PJBc0a1KJerDEEwAKAwDIpUMjRt X0eYOsGo49Cq0Be8UIzHj+IEe5TdVUrKy6zumJ6XgJVRLBFiCmNYQkvmktL/XEy1aP52 I5DA== X-Gm-Message-State: AOAM530soE3p9S1QW+itgMh+LcZqJ2KnzofVQrJ3f5gHU5pDjcYbSRoq MCRFjpHnsUlY39iZdxhyRbeebcbl/sS4ZjUoR3rt6A== X-Google-Smtp-Source: ABdhPJzqg9/cJFXzsEKuui5LLQmcVlIxqfx8S0xbUl9UXyu4UIrtiWJuNliEU6VKkP4JD9lJJVAJhVhQ6gN0sNwiUhw= X-Received: by 2002:a9d:851:: with SMTP id 75mr3804830oty.102.1606865906861; Tue, 01 Dec 2020 15:38:26 -0800 (PST) MIME-Version: 1.0 References: <20201201175144.3996569-1-minchan@kernel.org> <20201201175144.3996569-5-minchan@kernel.org> <20201201225554.GA3968963@google.com> In-Reply-To: <20201201225554.GA3968963@google.com> From: John Stultz Date: Tue, 1 Dec 2020 15:38:14 -0800 Message-ID: Subject: Re: [PATCH v2 4/4] dma-buf: heaps: add chunk heap to dmabuf heaps To: Minchan Kim Cc: Andrew Morton , LKML , linux-mm , Hyesoo Yu , Matthew Wilcox , david@redhat.com, iamjoonsoo.kim@lge.com, vbabka@suse.cz, Suren Baghdasaryan , KyongHo Cho , John Dias , Hridya Valsaraju , Sumit Semwal , Brian Starkey , linux-media , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Rob Herring , Christian Koenig , "moderated list:DMA BUFFER SHARING FRAMEWORK" Content-Type: text/plain; charset="UTF-8" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Dec 1, 2020 at 2:55 PM Minchan Kim wrote: > On Tue, Dec 01, 2020 at 11:48:15AM -0800, John Stultz wrote: > > On Tue, Dec 1, 2020 at 9:51 AM Minchan Kim wrote: > > > > Thanks for reworking and resending this! > > > > ... > > > +static int __init chunk_heap_init(void) > > > +{ > > > + struct cma *default_cma = dev_get_cma_area(NULL); > > > + struct dma_heap_export_info exp_info; > > > + struct chunk_heap *chunk_heap; > > > + > > > + if (!default_cma) > > > + return 0; > > > + > > > + chunk_heap = kzalloc(sizeof(*chunk_heap), GFP_KERNEL); > > > + if (!chunk_heap) > > > + return -ENOMEM; > > > + > > > + chunk_heap->order = CHUNK_HEAP_ORDER; > > > + chunk_heap->cma = default_cma; > > > + > > > + exp_info.name = cma_get_name(default_cma); > > > > So, this would create a chunk heap name with the default CMA name, > > which would be indistinguishable from the heap name used for the plain > > CMA heap. > > > > Probably a good idea to prefix it with "chunk-" so the heap device > > names are unique? > > That will give an impression to user that they are using different CMA > area but that's not true. IMHO, let's be honest at this moment. I disagree. The dmabuf heaps provide an abstraction for allocating a type of memory, and while your heap is pulling from CMA, you aren't "just" allocating CMA as the existing CMA heap would suffice for that. Since you need a slightly different method to allocate high order pages in bulk, we really should have a unique way to name the allocator interface. That's why I'd suggest the "chunk-" prefix to the heap name. thanks -john