[RFC V2 01/14] mm: Abstract printing of pxd_val()
Anshuman Khandual
anshuman.khandual at arm.com
Sun May 31 23:26:13 PDT 2026
On 21/05/26 3:12 PM, David Laight wrote:
> On Tue, 19 May 2026 07:28:17 -0700
> Dave Hansen <dave.hansen at intel.com> 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/1d694f9d-4f40-428b-aa28-9d6e0febd54c@arm.com/
More information about the linux-arm-kernel
mailing list