Re: [PATCH v2 04/33] mm: introduce and use vma_end_pgoff()

"Zi Yan" <[email protected]> Fri, 17 Jul 2026 22:35:08 -0400
Newsgroups org.kernel.vger.linux-sgx,dev.linux.lists.damon,dev.linux.lists.iommu,dev.linux.lists.nvdimm,org.freedesktop.lists.dri-devel,org.kernel.vger.kvm,org.kernel.vger.linux-arm-msm,org.kernel.vger.linux-fsdevel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-parisc,org.kernel.vger.linux-perf-users,org.kernel.vger.linux-tegra,org.kernel.vger.linux-trace-kernel,org.kvack.linux-mm
Message-ID <[email protected]>
On Fri Jul 10, 2026 at 4:16 PM EDT, Lorenzo Stoakes wrote:
> We already have vma_last_pgoff() which retrieves the last page offset
> within a VMA.
>
> However, code often wishes to span a page offset range, which requires th=
e
> exclusive end of this range.
>
> So provide this in vma_end_pgoff() and update vma_last_pgoff() to use thi=
s
> function.
>
> Also update the VMA userland tests to reflect the change.
>
> No functional change intended.
>
> Reviewed-by: Gregory Price <[email protected]>
> Reviewed-by: Pedro Falcato <[email protected]>
> Reviewed-by: Vlastimil Babka (SUSE) <[email protected]>
> Signed-off-by: Lorenzo Stoakes <[email protected]>
> ---
>  include/linux/mm.h              | 19 ++++++++++++++++++-
>  tools/testing/vma/include/dup.h |  5 +++++
>  2 files changed, 23 insertions(+), 1 deletion(-)
>
LGTM.

Reviewed-by: Zi Yan <[email protected]>

--=20
Best Regards,
Yan, Zi