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 B6995C77B75 for ; Tue, 18 Apr 2023 03:38:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230203AbjDRDiw (ORCPT ); Mon, 17 Apr 2023 23:38:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229662AbjDRDiu (ORCPT ); Mon, 17 Apr 2023 23:38:50 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D346211C for ; Mon, 17 Apr 2023 20:38:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=HhlSV7mwlecSkzDT1ht6NiuOggNho9wGWb49Qm4q5Uc=; b=b3nBOLBu3U2OnswmTGhD7y78cn njYxcT9bJC8E58gdiYUDpwiWjn6Swl7NwuIxeoy95MMxeY1w65jMh6W/BT2FZTX5vRBbnnb7Ytm/F 1VorRdyadHj+qadmUYVjf+qyOQU84SYCEM0um+cSEq+GkTUid/ygFXdKoZQ6QTdWZYCql9kt1VLaw oRrA3b8RBNarmlM7rgM48n7oRab6KU+JnDFMqjYIJhWhRTY8qPk4OkqW0zFAWa////CiyZOkLNqhw bGlzhMVpwZ8irdZKuFU6GFlubxEas5Bx4FzedOEtkWjR33zeAh6k1QOqFGDtrQH7fTEyojwcuhu3w IuoxQnOQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pocAi-00BvyK-OA; Tue, 18 Apr 2023 03:38:24 +0000 Date: Tue, 18 Apr 2023 04:38:24 +0100 From: Matthew Wilcox To: "zhaoyang.huang" Cc: Andrew Morton , Minchan Kim , Joonsoo Kim , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Zhaoyang Huang , ke.wang@unisoc.com Subject: Re: [PATCH] mm: fix printk format within cma Message-ID: References: <1681788789-19679-1-git-send-email-zhaoyang.huang@unisoc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1681788789-19679-1-git-send-email-zhaoyang.huang@unisoc.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 18, 2023 at 11:33:09AM +0800, zhaoyang.huang wrote: > cma and page pointer printed via %p are hash value which make debug to be hard. > change them to %px. Why does printing the page pointer make any sense at all? Surely the PFN makes much more sense. > [63321.482751] [c7] cma: cma_alloc(): memory range at 000000000b5e462c is busy, retrying > [63321.482786] [c7] cma: cma_alloc(): memory range at 000000000f7d6fae is busy, retrying > [63321.482823] [c7] cma: cma_alloc(): memory range at 00000000e653b59b is busy, retrying > [63322.378890] [c7] cma: cma_release(page 00000000dd53cf48) > [63322.378913] [c7] cma: cma_release(page 00000000315f703d) > [63322.378925] [c7] cma: cma_release(page 00000000791e3a5f) > > Signed-off-by: Zhaoyang Huang > --- > mm/cma.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/mm/cma.c b/mm/cma.c > index 4a978e0..dfe9813 100644 > --- a/mm/cma.c > +++ b/mm/cma.c > @@ -435,7 +435,7 @@ 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, > + pr_debug("%s(cma %px, count %lu, align %d)\n", __func__, (void *)cma, > count, align); > > if (!count) > @@ -534,7 +534,7 @@ bool cma_pages_valid(struct cma *cma, const struct page *pages, > pfn = page_to_pfn(pages); > > if (pfn < cma->base_pfn || pfn >= cma->base_pfn + cma->count) { > - pr_debug("%s(page %p, count %lu)\n", __func__, > + pr_debug("%s(page %px, count %lu)\n", __func__, > (void *)pages, count); > return false; > } > @@ -560,7 +560,7 @@ bool cma_release(struct cma *cma, const struct page *pages, > if (!cma_pages_valid(cma, pages, count)) > return false; > > - pr_debug("%s(page %p, count %lu)\n", __func__, (void *)pages, count); > + pr_debug("%s(page %px, count %lu)\n", __func__, (void *)pages, count); > > pfn = page_to_pfn(pages); > > -- > 1.9.1 > >