Re: [PATCH] mm: fix printk format within cma

From: Matthew Wilcox
Date: Fri Apr 28 2023 - 10:35:39 EST


On Tue, Apr 18, 2023 at 12:33:38PM -0700, Andrew Morton wrote:
> On Tue, 18 Apr 2023 04:38:24 +0100 Matthew Wilcox <willy@xxxxxxxxxxxxx> wrote:
>
> > On Tue, Apr 18, 2023 at 11:33:09AM +0800, zhaoyang.huang wrote:
> > > cma and page pointer printed via %p are hash value which make debug to be hard.
> > > change them to %px.
> >
> > Why does printing the page pointer make any sense at all? Surely the
> > PFN makes much more sense.
>
> I suppose one could correlate a particular hashed pointer with other
> debug output, see "ah, that's the same page". In which case one
> doesn't really care whether or not the address is hashed - it's just a
> cookie. This sounds thin.
>
> I doubt if a lot of thought went into the printk. If the page pointer
> isn't useful then how about we simply remove it from the message?

If something about it weren't useful, I don't think we'd be seeing a patch
to transform it from a hashed pointer to an unhashed pointer? I'm pretty
sure the PFN is the real information that's wanted here, since you can
look at the hardware RAM layout to determine why that's not eligible.