From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B6FCB381C4 for ; Fri, 10 Jul 2026 03:32:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783654343; cv=none; b=Two7RwbHtF7dRV8LdeYtVN3/8fMCLKkp8tD63YKzcviEfSBAJKiQYyiW5eKMVaOFNKPOxohptc1aAzqsW8RO24ChAKRh/MQP4E3Ha71VRbNzNHjrwFeP6Pk0l5RnZaCoZodB+8PHpnyvUUC5Ntr9dzjwrP5aMjPQ1l67Lr8WAuw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783654343; c=relaxed/simple; bh=9r/o8jxF/ZVglDB0yKi6A3uGQ7o4JF4GOuTmT46plI4=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=ZhW5DxDrOjM/W/stkRTeDn/dQq6ZzdTRGC4d3716KK/WoKbZsBX3L1SAjBkT+TPtJm+27cCbyv3ghp8BnqQLWt2qEHLuW6GeB+I9ySWFix26GVbrxIlttFLqbv6Q2GriBp86wxu0ueMRwh4nQfk8VkfH7liCbJOQXNoGYT2EbSo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=SQmEZ512; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="SQmEZ512" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E6B521F000E9; Fri, 10 Jul 2026 03:32:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1783654342; bh=mQ6hMMNdMWZsQvQubRaY7o6TY5m2sf5lSbS/0dE799E=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=SQmEZ512lakzjBI+To/Kg9qX2xfzBFENrhLV10TA7stQYPVYi1BqPJNKj+5ABvuXR ZnSMhfQyh/4UZXdCFenl5JupgriV/BjmLPbYn0+mnDmpCEvLLE2DD+ui/FXzTUo3K/ g5C9Zg88TZo7/4Tpq9YjtpZ6WSiamd9TLjTYgGWY= Date: Thu, 9 Jul 2026 20:32:21 -0700 From: Andrew Morton To: Anshuman Khandual Cc: linux-mm@kvack.org, andriy.shevchenko@linux.intel.com, usama.arif@linux.dev, hughd@google.com, willy@infradead.org, ryan.roberts@arm.com, "David Hildenbrand (Arm)" , linux-kernel@vger.kernel.org Subject: Re: [PATCH V3] mm: Standardize printing for pgtable entries Message-Id: <20260709203221.573de46038f027c2ccad641e@linux-foundation.org> In-Reply-To: <25857f58-9ef1-49e0-99f7-366d91028c02@arm.com> References: <20260709044334.1741263-1-anshuman.khandual@arm.com> <20260709170816.4e876a16eef9a93f41bb1940@linux-foundation.org> <25857f58-9ef1-49e0-99f7-366d91028c02@arm.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 10 Jul 2026 08:40:25 +0530 Anshuman Khandual wrote: > > > On 10/07/26 5:38 AM, Andrew Morton wrote: > > On Thu, 9 Jul 2026 10:13:34 +0530 Anshuman Khandual wrote: > > > >> From: "David Hildenbrand (Arm)" > >> > >> Bad page map reporting currently stores page table entry values in an > >> unsigned long long and prints them with fixed 64-bit-oriented format > >> strings. This is inconsistent across call sites and does not work well for > >> architectures where page table entry values are not naturally represented > >> as 64-bit values, such as 32-bit or 128-bit entries. > > > > Well grumble. It's a lot of fuss for something which nobody is hurting > > from. Or are they? What's the actual utility here? > > Current page table entries print does not work here for > 128 bits format (arm64 D128) because neither 'unsigned > long long' can hold 128 bits nor printing extracts u64 > from the 128 bit entries while printing with "%llx". > > Proposed a separate printk format %pp[te|md|ud|p4d|gd] > > https://lore.kernel.org/all/20260610043545.3725735-1-anshuman.khandual@arm.com/ > > But there after it was decided to rather have a local > solution in mm/memory.c instead of adding a new print > format. OK, thanks. Let's please spell such things out in the changelogging. Explaining how a change helps our users (ie, improves Linux) is super important! > >> if (!pgd_present(*pgdp) || pgd_leaf(*pgdp)) { > >> - pr_alert("pgd:%08llx\n", pgdv); > >> + pr_alert("pgd:%s\n", pgd_str); > > > > can this do > > pr_alert("pgd:%s\n", ptval_to_str(pgd_str, pgd_val(*pgdp))); > > > > and eliminate a few locals? > > But that would not eliminate any local variable. > > The helper ptval_to_str() does not return but instead > fills up the provided buffer which later gets printed. Well yes. Changing it to return `buf' was kinda implicit!