From: "Lorenzo Stoakes (ARM)" <ljs@kernel.org>
To: Matthew Wilcox <willy@infradead.org>
Cc: Gregory Price <gourry@gourry.net>,
"David Hildenbrand (Arm)" <david@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
"Liam R. Howlett" <liam@infradead.org>,
Vlastimil Babka <vbabka@kernel.org>,
Mike Rapoport <rppt@kernel.org>,
Suren Baghdasaryan <surenb@google.com>,
Michal Hocko <mhocko@suse.com>, Jann Horn <jannh@google.com>,
Pedro Falcato <pfalcato@suse.de>, Jan Kara <jack@suse.cz>,
Miaohe Lin <linmiaohe@huawei.com>,
Naoya Horiguchi <nao.horiguchi@gmail.com>,
Rik van Riel <riel@surriel.com>, Harry Yoo <harry@kernel.org>,
Lance Yang <lance.yang@linux.dev>, Kees Cook <kees@kernel.org>,
Zi Yan <ziy@nvidia.com>,
Baolin Wang <baolin.wang@linux.alibaba.com>,
Nico Pache <npache@redhat.com>,
Ryan Roberts <ryan.roberts@arm.com>, Dev Jain <dev.jain@arm.com>,
Barry Song <baohua@kernel.org>,
Usama Arif <usama.arif@linux.dev>,
Matthew Brost <matthew.brost@intel.com>,
Joshua Hahn <joshua.hahnjy@gmail.com>,
Rakie Kim <rakie.kim@sk.com>, Byungchul Park <byungchul@sk.com>,
Ying Huang <ying.huang@linux.alibaba.com>,
Alistair Popple <apopple@nvidia.com>,
Peter Xu <peterx@redhat.com>, Xu Xin <xu.xin16@zte.com.cn>,
Chengming Zhou <chengming.zhou@linux.dev>,
Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
linux-fsdevel@vger.kernel.org, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH v3 04/15] mm: update print_bad_page_map() to show anonymous page index
Date: Thu, 6 Aug 2026 18:18:38 +0100 [thread overview]
Message-ID: <anTAk9V9ceYq1jyt@lucifer> (raw)
In-Reply-To: <anS8UbQF1aE70gus@casper.infradead.org>
On Thu, Aug 06, 2026 at 05:54:41PM +0100, Matthew Wilcox wrote:
> On Wed, Aug 05, 2026 at 10:01:43AM +0100, Lorenzo Stoakes (ARM) wrote:
> > On Wed, Aug 05, 2026 at 04:30:18AM -0400, Gregory Price wrote:
> > > Yeah just an F/A in the print I suppose. Sorry if that was unclear.
> > >
> > > If it saves someone the head-scratch of whether some bug is because it's
> > > "file" or "true anon", given the ambiguity here, seems like maybe useful
> > > debug information.
> >
> > Yeah will do on respin I think actually!
> >
> > I do think not providing that could result in some confusion like 'hm I
> > thought this was file-backed'.
>
> not sure it would. Look at the whole thing:
>
> pr_alert("BUG: Bad page map in process %s %s:%08llx", current->comm,
> pgtable_level_to_str(level), entry);
> __print_bad_page_map_pgtable(vma->vm_mm, addr);
> if (page)
> dump_page(page, "bad page map");
> pr_alert("addr:%px vm_flags:%08lx anon_vma:%px mapping:%px index:%lx\n",
> (void *)addr, vma->vm_flags, vma->anon_vma, mapping, index);
> pr_alert("file:%pD fault:%ps mmap:%ps mmap_prepare: %ps read_folio:%ps\n",
> vma->vm_file,
> vma->vm_ops ? vma->vm_ops->fault : NULL,
> vma->vm_file ? vma->vm_file->f_op->mmap : NULL,
> vma->vm_file ? vma->vm_file->f_op->mmap_prepare : NULL,
> mapping ? mapping->a_ops->read_folio : NULL);
>
> even if we don't have 'page' and thus dump_page() won't tell us
> anything, we look at mapping (NULL means true-anon, non-NULL means
> file, possibly COW).
Ohhhh ok. But you still can't tell whether what's actually mapped in a
MAP_PRIVATE file-backed mapping.
So I still think giving separate anon and file indexes is useful for debugging
purposes in that case because you might be debugging an rmap thing and the
ranges of linear indexes might be handy.
>
> > (We've made our lives hard with varying definitions of 'anon'
> > also... [shmem being 'anon in page cache' is especially lol] so it's
> > already confusing but there we go :)
>
> Woah, woah, woah. Do *not* think of shmem as being anon-in-page-cache.
> shmem is a filesystem that happens to use swap to store its backing
> file. I dislike a number of things about how it's implemented, but
> describing it as anon-in-page-cache is furthering the confusion.
I am not sure 'file system that happens to use swap to back it' is that much
clearer ;)
But that _at least_ uses different terminology and swap-backed is pretty clear.
But :)
Functionally it's PG_swapbacked and !folio_test_anon() and nothing calls
it anon, except... well reclaim! Which gates on folio_test_swapbacked() for the
'anon' LRU and refers to it as anon throughout vmscan.c...
My point here was we made our lives difficult with naming and yeah we do. We so
so do.
--
Cheers, Lorenzo
next prev parent reply other threads:[~2026-08-06 17:19 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-29 16:48 [PATCH v3 00/15] mm/rmap: index MAP_PRIVATE file-backed folios by anonymous pgoff Lorenzo Stoakes (ARM)
2026-07-29 16:48 ` [PATCH v3 01/15] mm/vma: introduce VMA anon page offset field and add helpers Lorenzo Stoakes (ARM)
2026-07-29 17:11 ` Lorenzo Stoakes (ARM)
2026-07-30 3:32 ` Gregory Price
2026-08-03 9:28 ` David Hildenbrand (Arm)
2026-08-03 9:46 ` Lorenzo Stoakes (ARM)
2026-08-03 9:58 ` David Hildenbrand (Arm)
2026-08-03 10:13 ` Lorenzo Stoakes (ARM)
2026-07-29 16:48 ` [PATCH v3 02/15] mm: introduce linear_anon_page_index() Lorenzo Stoakes (ARM)
2026-07-30 6:28 ` Gregory Price
2026-08-03 9:34 ` David Hildenbrand (Arm)
2026-08-03 10:10 ` Lorenzo Stoakes (ARM)
2026-07-29 16:48 ` [PATCH v3 03/15] mm: abstract vma_address() and introduce vma_anon_address() Lorenzo Stoakes (ARM)
2026-07-30 4:58 ` Gregory Price
2026-07-30 6:39 ` Gregory Price
2026-07-30 10:16 ` Lorenzo Stoakes (ARM)
2026-08-03 9:37 ` David Hildenbrand (Arm)
2026-07-29 16:48 ` [PATCH v3 04/15] mm: update print_bad_page_map() to show anonymous page index Lorenzo Stoakes (ARM)
2026-07-30 6:32 ` Gregory Price
2026-08-03 9:39 ` David Hildenbrand (Arm)
2026-08-03 10:19 ` Lorenzo Stoakes (ARM)
2026-08-05 8:30 ` Gregory Price
2026-08-05 9:01 ` Lorenzo Stoakes (ARM)
2026-08-06 15:14 ` Lorenzo Stoakes (ARM)
2026-08-06 16:54 ` Matthew Wilcox
2026-08-06 17:18 ` Lorenzo Stoakes (ARM) [this message]
2026-08-03 9:39 ` David Hildenbrand (Arm)
2026-07-29 16:48 ` [PATCH v3 05/15] mm: introduce and use vma_filebacked_address() Lorenzo Stoakes (ARM)
2026-08-03 9:54 ` David Hildenbrand (Arm)
2026-08-03 10:15 ` Lorenzo Stoakes (ARM)
2026-07-29 16:48 ` [PATCH v3 06/15] mm: propagate VMA anonymous page offset on map, remap, split + merge Lorenzo Stoakes (ARM)
2026-08-03 10:52 ` David Hildenbrand (Arm)
2026-08-03 13:46 ` Lorenzo Stoakes (ARM)
2026-08-05 7:35 ` David Hildenbrand (Arm)
2026-08-05 8:59 ` Lorenzo Stoakes (ARM)
2026-08-05 9:19 ` David Hildenbrand (Arm)
2026-08-05 9:29 ` Lorenzo Stoakes (ARM)
2026-07-29 16:48 ` [PATCH v3 07/15] mm/rmap: track whether the page VMA mapped pgoff is anonymous Lorenzo Stoakes (ARM)
2026-08-03 10:57 ` David Hildenbrand (Arm)
2026-08-03 13:51 ` Lorenzo Stoakes (ARM)
2026-08-03 14:02 ` David Hildenbrand (Arm)
2026-08-03 14:32 ` Lorenzo Stoakes (ARM)
2026-08-05 7:17 ` David Hildenbrand (Arm)
2026-08-05 7:25 ` Lorenzo Stoakes (ARM)
2026-07-29 16:48 ` [PATCH v3 08/15] mm: introduce and use linear_folio_page_index() Lorenzo Stoakes (ARM)
2026-08-03 11:27 ` David Hildenbrand (Arm)
2026-08-03 14:30 ` Lorenzo Stoakes (ARM)
2026-08-05 7:26 ` David Hildenbrand (Arm)
2026-08-05 9:02 ` Lorenzo Stoakes (ARM)
2026-07-29 16:48 ` [PATCH v3 09/15] mm/rmap: use anon pgoff to track MAP_PRIVATE file-backed anon folios Lorenzo Stoakes (ARM)
2026-08-03 11:32 ` David Hildenbrand (Arm)
2026-08-03 14:30 ` Lorenzo Stoakes (ARM)
2026-07-29 16:48 ` [PATCH v3 10/15] tools/testing/vma: expand VMA merge tests to assert anon pgoff Lorenzo Stoakes (ARM)
2026-07-29 16:48 ` [PATCH v3 11/15] tools/testing/selftests/mm: test anonymous page offset merge behaviour Lorenzo Stoakes (ARM)
2026-07-29 16:48 ` [PATCH v3 12/15] mm/vma: only permit MAP_PRIVATE /dev/zero to be mapped anonymous Lorenzo Stoakes (ARM)
2026-07-29 16:48 ` [PATCH v3 13/15] mm/vma: make MAP_PRIVATE-mapped /dev/zero mappings truly anonymous Lorenzo Stoakes (ARM)
2026-07-29 16:48 ` [PATCH v3 14/15] tools/testing/vma: add test to assert MAP_PRIVATE-/dev/zero is anon Lorenzo Stoakes (ARM)
2026-07-29 16:48 ` [PATCH v3 15/15] tools/testing/selftests/mm: add MAP_PRIVATE-/dev/zero merge tests Lorenzo Stoakes (ARM)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=anTAk9V9ceYq1jyt@lucifer \
--to=ljs@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=apopple@nvidia.com \
--cc=arnd@arndb.de \
--cc=baohua@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=byungchul@sk.com \
--cc=chengming.zhou@linux.dev \
--cc=david@kernel.org \
--cc=dev.jain@arm.com \
--cc=gourry@gourry.net \
--cc=gregkh@linuxfoundation.org \
--cc=harry@kernel.org \
--cc=jack@suse.cz \
--cc=jannh@google.com \
--cc=joshua.hahnjy@gmail.com \
--cc=kees@kernel.org \
--cc=lance.yang@linux.dev \
--cc=liam@infradead.org \
--cc=linmiaohe@huawei.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=matthew.brost@intel.com \
--cc=mhocko@suse.com \
--cc=nao.horiguchi@gmail.com \
--cc=npache@redhat.com \
--cc=peterx@redhat.com \
--cc=pfalcato@suse.de \
--cc=rakie.kim@sk.com \
--cc=riel@surriel.com \
--cc=rppt@kernel.org \
--cc=ryan.roberts@arm.com \
--cc=surenb@google.com \
--cc=usama.arif@linux.dev \
--cc=vbabka@kernel.org \
--cc=willy@infradead.org \
--cc=xu.xin16@zte.com.cn \
--cc=ying.huang@linux.alibaba.com \
--cc=ziy@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox