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=-8.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 470BBC433DB for ; Tue, 19 Jan 2021 20:36:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C66DC2310B for ; Tue, 19 Jan 2021 20:36:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C66DC2310B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 116D76B0005; Tue, 19 Jan 2021 15:36:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0C8366B0006; Tue, 19 Jan 2021 15:36:46 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EF8AF6B0007; Tue, 19 Jan 2021 15:36:45 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0239.hostedemail.com [216.40.44.239]) by kanga.kvack.org (Postfix) with ESMTP id D86A76B0005 for ; Tue, 19 Jan 2021 15:36:45 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 9EB5E181AF5C6 for ; Tue, 19 Jan 2021 20:36:45 +0000 (UTC) X-FDA: 77723683170.01.land41_340ab5f27554 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin01.hostedemail.com (Postfix) with ESMTP id 6738F1004F93C for ; Tue, 19 Jan 2021 20:36:45 +0000 (UTC) X-HE-Tag: land41_340ab5f27554 X-Filterd-Recvd-Size: 5402 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by imf09.hostedemail.com (Postfix) with ESMTP for ; Tue, 19 Jan 2021 20:36:44 +0000 (UTC) Received: by mail-pl1-f171.google.com with SMTP id e9so7052999plh.3 for ; Tue, 19 Jan 2021 12:36:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=B8V4SvilY22Ou2CtEY4Ue8qbjrsp3tthnLCK+7Q59QY=; b=PeAXI8eTzedOObem6tpD3NZRZKrBkgPenj/spRJ6lVUlMubwNa3Hsb2icgzXSomLqy jZ0E6xPVrfpe5ilrFFeyILMIUF5YcgHQi8+CknGm8Z7ZWUZZCKKEMDt51BM3ZYstg0yS 2eROI954uU0JzmDnA7QdgSEGNXTAfT2mPXLCf5SRW6gvfz0nZx1CGzLXdOpj0nPZz7V4 y59gAQtbX2e1l++jNfgypKC6n73SaA/zOLG1zk0c85OMOYgSZgOx+w37YU2SDizmy0t1 fvYjxUEcFgSQxSZ+zg5/YjdqyN0owSiUhq96CQQhEn4PximkBY0CGFHHAzCp3nk1Coad NRDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=B8V4SvilY22Ou2CtEY4Ue8qbjrsp3tthnLCK+7Q59QY=; b=bYkeX5d7s9gMWUshDrRhVRhX/Otb9lfy/V5b0EWHpoyKviMZP1aALOpkZk/xdfoQqc DeHQWizB3lzXT492qYqYj5duei9Rfc+UyAhXp93WEn8U9k2GS9MrBzmGoKKO/Q+H4RVd ZpvFOWU5GsHowOXcjY+2wIJmUQUAW57NlJoZZfeGWNFuXTrYj1l3MtuVh6ra00TZ8Zmw tByaZ/NWCy65rM9IdfWvtG2dv+T5v/lvLqarf0Fogb6lx+Aj5FBOP1nEv2aIGlPkZrqz 9zY4HMZlBzMhHGcbiB4ROn+Sz/QOybSRg6TugTPIc+/UjNIGeyH1y9W64ksza4880oHX kssA== X-Gm-Message-State: AOAM532dHRpMIsGwsmfeM19Q1310LmW5vu/kJHl+uk216DETWE7zojx0 d1VFFT4ya1PYB4xLjU2sTJM= X-Google-Smtp-Source: ABdhPJxMgNFUumt9XiceexCYO3QOZQGhZnpeiTmcQUHGdDtv9MMjBRezO5wS52FU++T2/s/pwxcgsg== X-Received: by 2002:a17:902:d909:b029:df:52b4:8147 with SMTP id c9-20020a170902d909b02900df52b48147mr1944220plz.33.1611088603852; Tue, 19 Jan 2021 12:36:43 -0800 (PST) Received: from google.com ([2620:15c:211:201:8d1f:e7:cd3c:db2f]) by smtp.gmail.com with ESMTPSA id b67sm1171pfa.140.2021.01.19.12.36.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Jan 2021 12:36:42 -0800 (PST) Date: Tue, 19 Jan 2021 12:36:40 -0800 From: Minchan Kim To: John Stultz Cc: Andrew Morton , linux-mm , LKML , Hyesoo Yu , david@redhat.com, Michal Hocko , Suren Baghdasaryan , KyongHo Cho , John Dias , Hridya Valsaraju , Sumit Semwal , linux-media , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Christoph Hellwig , Rob Herring , "moderated list:DMA BUFFER SHARING FRAMEWORK" Subject: Re: [PATCH v3 4/4] dma-buf: heaps: add chunk heap to dmabuf heaps Message-ID: References: <20210113012143.1201105-1-minchan@kernel.org> <20210113012143.1201105-5-minchan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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, Jan 19, 2021 at 10:29:29AM -0800, John Stultz wrote: > On Tue, Jan 12, 2021 at 5:22 PM Minchan Kim wrote: > > > > From: Hyesoo Yu > > > > This patch supports chunk heap that allocates the buffers that > > arranged into a list a fixed size chunks taken from CMA. > > > > The chunk heap driver is bound directly to a reserved_memory > > node by following Rob Herring's suggestion in [1]. > > > > [1] https://lore.kernel.org/lkml/20191025225009.50305-2-john.stultz@linaro.org/T/#m3dc63acd33fea269a584f43bb799a876f0b2b45d > > > > Signed-off-by: Hyesoo Yu > > Signed-off-by: Hridya Valsaraju > > Signed-off-by: Minchan Kim > > --- > ... > > +static int register_chunk_heap(struct chunk_heap *chunk_heap_info) > > +{ > > + struct dma_heap_export_info exp_info; > > + > > + exp_info.name = cma_get_name(chunk_heap_info->cma); > > One potential issue here, you're setting the name to the same as the > CMA name. Since the CMA heap uses the CMA name, if one chunk was > registered as a chunk heap but also was the default CMA area, it might > be registered twice. But since both would have the same name it would > be an initialization race as to which one "wins". Good point. Maybe someone might want to use default CMA area for both cma_heap and chunk_heap. I cannot come up with ideas why we should prohibit it atm. > > So maybe could you postfix the CMA name with "-chunk" or something? Hyesoo, Any opinion? Unless you have something other idea, let's fix it in next version.