All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: Pedro Falcato <pfalcato@suse.de>,
	"David Hildenbrand (Arm)" <david@kernel.org>,
	Zi Yan <ziy@nvidia.com>, "Liam R. Howlett" <liam@infradead.org>,
	Lorenzo Stoakes <ljs@kernel.org>,
	Vlastimil Babka <vbabka@kernel.org>,
	Suren Baghdasaryan <surenb@google.com>, <linux-mm@kvack.org>
Subject: Re: [PATCH v2 1/4] mm: mincore: use walk_page_range_vma() in do_mincore()
Date: Wed, 24 Jun 2026 19:38:52 -0700	[thread overview]
Message-ID: <20260624193852.2a1ac8a187978e4baa75f47e@linux-foundation.org> (raw)
In-Reply-To: <e7244b54-d794-4e46-88e7-69204da2b60d@huawei.com>

On Mon, 22 Jun 2026 11:23:11 +0800 Kefeng Wang <wangkefeng.wang@huawei.com> wrote:

> >>>> -	err = walk_page_range(vma->vm_mm, addr, end, &mincore_walk_ops, vec);
> >>>> +
> >>>> +	/*
> >>>> +	 * walk_page_range_vma() does not call walk_page_test(), which
> >>>> +	 * handles VM_PFNMAP VMA by invoking ->pte_hole() to skip the
> >>>> +	 * page table walk. Without this check, PFNMAP PTEs would be
> >>>> +	 * treated as present by mincore_pte_range(), changing the returned
> >>>> +	 * residency status from the historical "not resident" to "resident".
> >>>> +	 * Handle VM_PFNMAP explicitly to preserve the original behavior.
> >>>> +	 */
> > 
> > I would rather we amend this comment to something like:
> > 
> > 	/* mincore (historically) reports PFNMAP mappings as non-resident. */
> > 
> > because we don't need to explain internal differences in walk_page_range
> > functions in a random comment in mincore. And perhaps attempt a separate
> 
> Hope Andrew can fix the comments when pickup patches.

I added this:

--- a/mm/mincore.c~mm-mincore-use-walk_page_range_vma-in-do_mincore-fix
+++ a/mm/mincore.c
@@ -261,12 +261,7 @@ static long do_mincore(unsigned long add
 	}
 
 	/*
-	 * walk_page_range_vma() does not call walk_page_test(), which
-	 * handles VM_PFNMAP VMA by invoking ->pte_hole() to skip the
-	 * page table walk. Without this check, PFNMAP PTEs would be
-	 * treated as present by mincore_pte_range(), changing the returned
-	 * residency status from the historical "not resident" to "resident".
-	 * Handle VM_PFNMAP explicitly to preserve the original behavior.
+	 * mincore historically reports PFNMAP mappings as non-resident.
 	 */
 	if (vma->vm_flags & VM_PFNMAP) {
 		__mincore_unmapped_range(addr, end, vma, vec);
_


Sashiko is OK with your patchset, but it might have found four(!)
pre-existing issues:

	https://sashiko.dev/#/patchset/20260618092845.3905740-1-wangkefeng.wang@huawei.com


  reply	other threads:[~2026-06-25  2:38 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-18  9:28 [PATCH v2 0/4] mm: convert to walk_page_range_vma() to eliminate find_vma() Kefeng Wang
2026-06-18  9:28 ` [PATCH v2 1/4] mm: mincore: use walk_page_range_vma() in do_mincore() Kefeng Wang
2026-06-18 11:34   ` David Hildenbrand (Arm)
2026-06-18 11:49   ` Pedro Falcato
2026-06-18 12:58     ` David Hildenbrand (Arm)
2026-06-18 13:01     ` Kefeng Wang
2026-06-18 15:02       ` Pedro Falcato
2026-06-22  3:23         ` Kefeng Wang
2026-06-25  2:38           ` Andrew Morton [this message]
2026-06-26 15:21             ` Kefeng Wang
2026-06-26 15:58               ` David Hildenbrand (Arm)
2026-06-27  2:02                 ` Kefeng Wang
2026-06-18  9:28 ` [PATCH v2 2/4] mm: mprotect: use walk_page_range_vma() in mprotect_fixup() Kefeng Wang
2026-06-18 11:52   ` Pedro Falcato
2026-06-18  9:28 ` [PATCH v2 3/4] mm: mlock: use walk_page_range_vma() in mlock_vma_pages_range() Kefeng Wang
2026-06-18 11:53   ` Pedro Falcato
2026-06-18  9:28 ` [PATCH v2 4/4] mm: migrate_device: use walk_page_range_vma() in migrate_vma_collect() Kefeng Wang
2026-06-18 11:53   ` Pedro Falcato

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=20260624193852.2a1ac8a187978e4baa75f47e@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=david@kernel.org \
    --cc=liam@infradead.org \
    --cc=linux-mm@kvack.org \
    --cc=ljs@kernel.org \
    --cc=pfalcato@suse.de \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.org \
    --cc=wangkefeng.wang@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.