Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp269643pxu; Wed, 25 Nov 2020 20:25:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJwINa288w/fdWnwI+G1+cunvg6RnQJTXIKfw7ZE21M5jLiB34lJcKlqwZ+HsN0NSAQ+uyPE X-Received: by 2002:a05:6402:3116:: with SMTP id dc22mr832835edb.252.1606364716240; Wed, 25 Nov 2020 20:25:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606364716; cv=none; d=google.com; s=arc-20160816; b=oc5cbEkXyl1WFiakUX6Rmeh2A2p8YSWIOxVDYjjEAoh46+iemGM8m4uhs0HEXqxeXr t+02sKrEblN9lFW7NCVfrpjbrR8IhpR30xUM+eKjIG1oyDu41PyLb2hkziF8j8N5AFdB e/TAamWWRcUaGH5EtroOgSGyzPpixoDpVLEutziVzYQp1Q6HVBhlKrW6VpBHDrGgDXpF T6o6oHWXUyckhgjBfwhLRjBawjqWV2LNesHhwWjWbQchb3cH/SowRSLrUUlzkwREs7Lc fcypOAbMTnXmF9pY2XAJnCsgNh80qkmqX+fAvTFFRB+j+8xFU/B8O+n6bAPwVWns9ceA Cpnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:dkim-signature; bh=+ScC2iD5+F6+dcEymW2ZVsRHtouJI90gVvqKnZPqZNY=; b=qq/uQk61qpqXWVSR7b9RRC3YVPssaEaNICi7rPe0yrJipbvBNV9LRFLWEr+/mtV9kE +WJWPYka9wFgB4mTZypBxGtawftE1xXBUMiQtJqxOCQWCRVH/r9lAtSGfSK/rces61eA Oymj82QW97B06t/yIJ+rYgtrEwI9B74m86nG7D841fbYZv04NH21Kb7F1RF1FXaXGktu ETbvripN859WcpyaaH5POCPFxzrYCWlq1AJBxwadiX4n9PFZ8ZpLtGM0Glif16Ib3DVC yA5fNWVGsGi8eIWiYm/D0jIMyrU9WcXOnYryHObux5L9XE/3O9odTN7T+Z58Jr11yhdr FNqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UaFwPiR3; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q22si2410725ejy.29.2020.11.25.20.24.53; Wed, 25 Nov 2020 20:25: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=@redhat.com header.s=mimecast20190719 header.b=UaFwPiR3; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732021AbgKYQjq (ORCPT + 99 others); Wed, 25 Nov 2020 11:39:46 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:47505 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730247AbgKYQjq (ORCPT ); Wed, 25 Nov 2020 11:39:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606322385; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+ScC2iD5+F6+dcEymW2ZVsRHtouJI90gVvqKnZPqZNY=; b=UaFwPiR3ZWkiCktkWjvkqIyH+W7ltc+pdZ+3Iz7rg5giXkD/yYERLNsXJkgR5/QM9lTlRY 46rnyxhwZjun3WqoymNVA4FhG+afVDsTcEQ4rEEN7ti9WwApFTcfh+RP6W4K2NrZveE8/F OqI2E3Mc2+c/J5Jb4oeIhXMwKVuTBCo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-72-Gfuy4hdzNBSVKthwn4r-AQ-1; Wed, 25 Nov 2020 11:39:41 -0500 X-MC-Unique: Gfuy4hdzNBSVKthwn4r-AQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CA52A911E2; Wed, 25 Nov 2020 16:39:39 +0000 (UTC) Received: from [10.36.112.131] (ovpn-112-131.ams2.redhat.com [10.36.112.131]) by smtp.corp.redhat.com (Postfix) with ESMTP id 408535D71F; Wed, 25 Nov 2020 16:39:38 +0000 (UTC) Subject: Re: [PATCH] mm: cma: improve pr_debug log in cma_release() To: Charan Teja Reddy , akpm@linux-foundation.org, iamjoonsoo.kim@lge.com, linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, vinmenon@codeaurora.org References: <1606318341-29521-1-git-send-email-charante@codeaurora.org> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: <9bde4b9a-58e4-b756-af45-1559fc06dcd4@redhat.com> Date: Wed, 25 Nov 2020 17:39:37 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <1606318341-29521-1-git-send-email-charante@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25.11.20 16:32, Charan Teja Reddy wrote: > 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); > > Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb