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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07009EB64D9 for ; Fri, 7 Jul 2023 10:28:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232605AbjGGK2D (ORCPT ); Fri, 7 Jul 2023 06:28:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232671AbjGGK1w (ORCPT ); Fri, 7 Jul 2023 06:27:52 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2F34C10E2 for ; Fri, 7 Jul 2023 03:27:48 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E1D89D75; Fri, 7 Jul 2023 03:28:29 -0700 (PDT) Received: from [10.163.48.50] (unknown [10.163.48.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 17F733F740; Fri, 7 Jul 2023 03:27:45 -0700 (PDT) Message-ID: <26816f0a-7f55-f5ce-b71d-769011f9230f@arm.com> Date: Fri, 7 Jul 2023 15:57:42 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v2] mm: cma: print cma name as well in cma_alloc debug To: Pintu Kumar , linux-kernel@vger.kernel.org, akpm@linux-foundation.org, linux-mm@kvack.org Cc: pintu.ping@gmail.com References: <1688668070-8408-1-git-send-email-quic_pintu@quicinc.com> <1688668414-12350-1-git-send-email-quic_pintu@quicinc.com> Content-Language: en-US From: Anshuman Khandual In-Reply-To: <1688668414-12350-1-git-send-email-quic_pintu@quicinc.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/7/23 00:03, Pintu Kumar wrote: > CMA allocation can happen either from global cma or from > dedicated cma region. > > Thus it is helpful to print cma name as well during initial > debugging to confirm cma regions were getting initialized or not. > > Signed-off-by: Pintu Kumar > Signed-off-by: Pintu Agarwal > --- > mm/cma.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/mm/cma.c b/mm/cma.c > index a4cfe99..4880f72 100644 > --- a/mm/cma.c > +++ b/mm/cma.c > @@ -436,8 +436,8 @@ struct page *cma_alloc(struct cma *cma, unsigned long count, > if (!cma || !cma->count || !cma->bitmap) > goto out; > > - pr_debug("%s(cma %p, count %lu, align %d)\n", __func__, (void *)cma, > - count, align); > + pr_debug("%s(cma %p, name: %s, count %lu, align %d)\n", __func__, > + (void *)cma, cma->name, count, align); > > if (!count) > goto out; LGTM, cma->name is an identifying attribute for the region for which the allocation request was made. But how about using cma_get_name() helper instead ? Very few call sites have been using the helper.