Subject: Re: [RFC V2 01/14] mm: Abstract printing of pxd_val()

From: Anshuman Khandual <[email-masked]>
Date: Mon, 1 Jun 2026 11:56:13 +0530

On 21/05/26 3:12 PM, David Laight wrote:
> On Tue, 19 May 2026 07:28:17 -0700
> Dave Hansen <[email-masked]> wrote:
> 
>> On 5/12/26 21:45, Anshuman Khandual wrote:
>>>  	if (!p4d_present(p4d) || p4d_leaf(p4d)) {
>>> -		pr_alert("pgd:%08llx p4d:%08llx\n", pgdv, p4dv);
>>> +		pr_alert("pgd:%" __PRIpxx " p4d:%" __PRIpxx "\n",
>>> +			 __PRIpxx_args(pgdv), __PRIpxx_args(p4dv));
>>>  		return;
>>>  	}  
>>
>> That's not the most readable result. Could a printk() format specifier
>> make this nicer? Maybe use "%pT"?
>>
>> 	pr_alert("pgd:%pT p4d:%pT\n", &pgd, &p4d);
>>
>> I _think_ it could even get rid of the p??v variables.
>>
> 
> Adding another %p variant that is only used in a few places just makes
> it all harder to read.
> Perhaps a local helper that lets you do:
> 	char pdgv_buf[??]:
> 	pr_alert("... %s ...", ... fmt_pdgv(pdgv_buf, pdgv) ...)
> might be a reasonable compromise.

But will not that also create a similar code churn as adding %p variant ?
As mentioned earlier a draft implementation could be found here.

https://lore.kernel.org/all/[email-masked]/