Re: [PATCH v3 04/15] mm: update print_bad_page_map() to show anonymous page index

"Lorenzo Stoakes (ARM)" <[email protected]>
Newsgroups gmane.linux.file-systems,gmane.linux.kernel.mm,gmane.linux.kernel
Message-ID <anBqV9z6hVLIqoIn@lucifer>
On Mon, Aug 03, 2026 at 11:39:11AM +0200, David Hildenbrand (Arm) wrote:
> On 7/30/26 08:32, Gregory Price wrote:
> > On Wed, Jul 29, 2026 at 05:48:39PM +0100, Lorenzo Stoakes (ARM) wrote:
> >> This is potentially useful debugging information and matches the existing
> >> page offset provided.
> >>
> >> Use the raw __linear_anon_page_index() function so as to always output this
> >> value regardless of whether the mapping is file-backed or not.
> >>
> >
> > Begs the question whether we should mark the value based on whether
> > it is file backed or not, but i suppose you can gleen that from the
> > other printed values (anon_mem, mapping, vm_ops, etc).
>
> You mean something anon_pgoff_t or what did you have in mind?

I suspect he means e.g. adding a (A) suffix or something? Like page offset xxx
(F) or yyy (A) I guess?

For anon_pgoff_t it'd have to be a typedef struct { pgoff_t val; } anon_pgoff_t
to be meaningful and then you'd have weirdness with assignment to
e.g. folio->index/other calculations, and especially linear_folio_index() which
returns the right pgoff_t depending on file-backed/anon :)

So I don't think it'd be helpful, and the asserts already prevent incorrect
usage.

>
> --
> Cheers,
>
> David

--
Cheers, Lorenzo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.