Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp40017pxu; Wed, 25 Nov 2020 12:30:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJy1ISfPDqz0KGMA1VEhiiywzGolsCLaPIXvFeVyC6MZShFIG6NJxP9Quzjkc/EpWcny717Y X-Received: by 2002:a17:906:1db1:: with SMTP id u17mr4820310ejh.359.1606336216357; Wed, 25 Nov 2020 12:30:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606336216; cv=none; d=google.com; s=arc-20160816; b=dD/ZhaXU+xjdwdygfkkIJlJorfYpekQUTrilK2hWewY0x3h5ODlMY1LCmiyKQCdnFR kn4nqccrVC4SFjKBvHgiJP3z+mtGwIExi++wpl4V3bna+zmYJd/TWexoO3nVHWPo4vHM FmOu7CJifj34hZXG3uDqOJjeJbHxgloN1X5aragGclJ7+tCI4p1WkhWUFPOzstJl9P+E UUoGfbZ5jy4lfjEkUKPMMJOhYx/D1+nm1i9NZxqNGde1+q9QiQb3MIZYwdxOJjcbfVar y2glTTo5Y5ftKDkz42Du7fUCYWlzoWMMs33FsdFwpFTe5y+uSj3Feq85xwb6JhQfOmIp ySPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from:dmarc-filter :sender:dkim-signature; bh=1+TC3IYLJcqS2Bupzdlu7MVB2ra419DrH4Nlfpu0yk8=; b=CZ+WCHrY7pWcV3FtCE1VcZs+EPpm64Kc1doT/Ie5rUGNNtDVtSNH4Ba5xe3JNUmoOV sqotClzVXrOURU/T2d6ziyMSdIhlz9zTxquh9nRHyR5AP/srcHkKwRmYc8Lshh1cpNZC 2tXL/cKzYKuXhokuceKdu5CLzDxbEUHfOQHv/2QlMwwsggRMRQXEdyMhhZSCZOuMs5cj NDfKwysN0SezcDbhyBKS+21mmtMvxnEIT+7WkQgG8ed0DR5HvUrrOC69seZ3pYN9GbMc UB+jDDyng296wgNLYppJ2YLVnA1/Iiwlu7MiAo/hLjMdxNZ/aErk9nAVF7Nv63vM2T83 JXOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b="O9qD/1kq"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e20si1839821eja.480.2020.11.25.12.29.52; Wed, 25 Nov 2020 12:30:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b="O9qD/1kq"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730312AbgKYPcm (ORCPT + 99 others); Wed, 25 Nov 2020 10:32:42 -0500 Received: from z5.mailgun.us ([104.130.96.5]:42361 "EHLO z5.mailgun.us" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730308AbgKYPcm (ORCPT ); Wed, 25 Nov 2020 10:32:42 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1606318361; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=1+TC3IYLJcqS2Bupzdlu7MVB2ra419DrH4Nlfpu0yk8=; b=O9qD/1kqWiNOSDgGZdVy+tckrHL2Uiae8bHQA3JeYtNs5i205PHm01be+Ey7Rj3tgHfN1PjZ qjOJAbZsThbiYPd6Rmhky4vTodeSVEBzFoc2+fZ8x1A3++5H3pns0nDu0Gpnx8IYjC09/bnv Uh6KxOPGnihkHHaWwbpfXxzCTqI= X-Mailgun-Sending-Ip: 104.130.96.5 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n03.prod.us-west-2.postgun.com with SMTP id 5fbe79117e9d874dfc03d270 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 25 Nov 2020 15:32:33 GMT Sender: charante=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 6D74EC43461; Wed, 25 Nov 2020 15:32:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from charante-linux.qualcomm.com (unknown [202.46.22.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: charante) by smtp.codeaurora.org (Postfix) with ESMTPSA id 93090C43460; Wed, 25 Nov 2020 15:32:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 93090C43460 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=charante@codeaurora.org From: Charan Teja Reddy To: akpm@linux-foundation.org, iamjoonsoo.kim@lge.com, linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, vinmenon@codeaurora.org, Charan Teja Reddy Subject: [PATCH] mm: cma: improve pr_debug log in cma_release() Date: Wed, 25 Nov 2020 21:02:21 +0530 Message-Id: <1606318341-29521-1-git-send-email-charante@codeaurora.org> X-Mailer: git-send-email 2.7.4 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It is required to print 'count' of pages, along with the pages, passed to cma_release to debug the cases of mismatched count value passed between cma_alloc() and cma_release() from a code path. As an example, consider the below scenario: 1) CMA pool size is 4MB and 2) User doing the erroneous step of allocating 2 pages but freeing 1 page in a loop from this CMA pool. The step 2 causes cma_alloc() to return NULL at one point of time because of -ENOMEM condition. And the current pr_debug logs is not giving the info about these types of allocation patterns because of count value not being printed in cma_release(). We are printing the count value in the trace logs, just extend the same to pr_debug logs too. Signed-off-by: Charan Teja Reddy --- mm/cma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/cma.c b/mm/cma.c index 7f415d7..07c904b 100644 --- a/mm/cma.c +++ b/mm/cma.c @@ -512,7 +512,7 @@ bool cma_release(struct cma *cma, const struct page *pages, unsigned int count) if (!cma || !pages) return false; - pr_debug("%s(page %p)\n", __func__, (void *)pages); + pr_debug("%s(page %p, count %zu)\n", __func__, (void *)pages, count); pfn = page_to_pfn(pages); -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation