Re: [PATCH] lib/hexdump: introduce DUMP_PREFIX_UNHASHED for unhashed addresses

From: Timur Tabi
Date: Sat Jan 16 2021 - 15:57:29 EST

On Fri, Jan 15, 2021 at 3:24 AM Petr Mladek <pmladek@xxxxxxxx> wrote:

> By other words, every print_hex_dump() used need to be reviewed in
> which context might be called.

I did a rough analysis of all current usage of DUMP_PREFIX_ADDRESS in
the kernel, compared to the introduction of %px and hashed addresses,
using git-blame to find the most recent commit that modifies a line
that contains _ADDRESS. Of 150 cases, 110 of them are newer than %px,
so I'm assuming that these developers chose _ADDRESS instead of
_OFFSET knowing that the addresses are hashed.

> > If you want, I can include a patch that changes a few callers of
> > print_hex_dump() to use DUMP_PREFIX_UNHASHED, based on what I think would be
> > useful.
> It would be nice.

I have a v2 that I'm about to post, and I included a patch that
modifies check_poison_mem() in mm/page_poison.c. I chose this file
because I figured actual addresses would probably be necessary for
tracking memory-related errors. Also, that call to print_hex_dump()
was added back in 2009, so it predates the introduction of %px.