Re: [RFC] mm: Drop pxd_ERROR()
"David Hildenbrand (Arm)" <[email protected]>
| Newsgroups | org.kernel.vger.linux-arch,org.kernel.vger.linux-kernel,org.kvack.linux-mm |
|---|---|
| Message-ID | <[email protected]> |
On 8/6/26 10:06, Anshuman Khandual wrote:
> pxd_ERROR() has been used in generic mm just to print the page table entry
> in pxd_clear_bad() before clearing those out with pxd_clear() later. These
> pxd_ERROR() macros have been provided by all platforms which basically did
> the same thing.
>
> Make pxd_clear_bad() use recently added ptval_to_str() instead for printing
> page table entries thus completely dropping dependency on platform provided
> pxd_ERROR() macros which can then be dropped off. First move all required
> helpers in core MM into a header file which could then be used else where.
>
> Although some platforms still use those macros internally as well. In which
> case just move these macros inside the platform for now.
No, just get rid of them first.
The ones in arch/sh/mm/init.c are just supid:
if (pgd_none(*pgd)) {
pgd_ERROR(*pgd);
printing a none PGD? Stupid. :)
Then there is arch/parisc/kernel/pci-dma.c, which just open-codes
pmd_clear_bad() ?
pmd_ERROR(*pmd);
pmd_clear(pmd);
Anything else?
>
> Cc: David Hildenbrand (Arm) <[email protected]>
> Cc: Andrew Morton <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Signed-off-by: Anshuman Khandual <[email protected]>
> ---
> This applies on v7.2-rc6 but after the following patch
>
> https://lore.kernel.org/all/[email protected]/
>
> Would it also make sense to just drop __FILE__ and __LINE__ from the output
> in pxd_clear_bad() helpers as they always print the same details regardless
> the error path and does not add much value.
Yes, drop that, it's nonsensical given that all relevant calls are from
mm/pgtable-generic.c
Thanks for looking into this!
--
Cheers,
David