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 17B24E95A91 for ; Mon, 9 Oct 2023 13:26:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376768AbjJIN0J (ORCPT ); Mon, 9 Oct 2023 09:26:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376701AbjJIN0D (ORCPT ); Mon, 9 Oct 2023 09:26:03 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E0C0D6 for ; Mon, 9 Oct 2023 06:26:01 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD895C433C9; Mon, 9 Oct 2023 13:25:59 +0000 (UTC) Date: Mon, 9 Oct 2023 14:25:57 +0100 From: Catalin Marinas To: Liu Shixin Cc: Patrick Wang , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 4/4] mm/kmemleak: fix print format of pointer in pr_debug() Message-ID: References: <20231008023317.3015699-1-liushixin2@huawei.com> <20231008023317.3015699-5-liushixin2@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231008023317.3015699-5-liushixin2@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Oct 08, 2023 at 10:33:17AM +0800, Liu Shixin wrote: > With 0x%p, the pointer will be hashed and print (____ptrval____) instead. > And with 0x%pa, the pointer can be successfully printed but with duplicate > prefixes, which looks like: > > kmemleak: kmemleak_free(0x(____ptrval____)) > kmemleak: kmemleak_free_percpu(0x(____ptrval____)) > kmemleak: kmemleak_free_part_phys(0x0x0000000a1af86000) > > Use 0x%px instead of 0x%p or 0x%pa to print the pointer. Then the print > will be like: > > kmemleak: kmemleak_free(0xffff9111c145b020) > kmemleak: kmemleak_free_percpu(0x00000000000333b0) > kmemleak: kmemleak_free_part_phys(0x0000000a1af80000) > > Signed-off-by: Liu Shixin Acked-by: Catalin Marinas