Re: [PATCH V2] mm: Standardize printing for pgtable entries

From: Anshuman Khandual

Date: Wed Jul 08 2026 - 23:52:57 EST




On 08/07/26 4:47 PM, Andy Shevchenko wrote:
> On Wed, Jul 08, 2026 at 08:58:23AM +0530, Anshuman Khandual wrote:
>
>> 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.
>>
>> Introduce a common helper to convert raw page table entry values into a
>> fixed-width hexadecimal string based on the actual entry size. Use it for
>> bad page map reporting and for dumping the page table walk in
>> __print_bad_page_map_pgtable().
>>
>> Pass page table entry values to the reporting path as raw bytes together
>> with their size, instead of forcing them through an unsigned long long.
>> It keeps the printed output consistent and avoids truncation or misleading
>> formatting for non-64-bit page table entries.
>
> Why do you still use __auto_* instead of 'auto'?
> Please, see the comment in compiler_types.h about this.

/*
* C23 introduces "auto" as a standard way to define type-inferred
* variables, but "auto" has been a (useless) keyword even since K&R C,
* so it has always been "namespace reserved."
*
* Until at some future time we require C23 support, we need the gcc
* extension __auto_type, but there is no reason to put that elsewhere
* in the source code.
*/
#if __STDC_VERSION__ < 202311L
# define auto __auto_type
#endif

Alright 'auto' could be used for toolschain both before and after C23.
Will do the replacement s/__auto_type/auto