Re: [PATCH v1 14/16] mm: rename zap_page_range_single() to zap_vma_range()

Puranjay Mohan
2026-03-09T16:46:18Z

"David Hildenbrand (Arm)" <david@kernel.org> writes:

> Let's rename it to make it better match our new naming scheme.
>
> While at it, polish the kerneldoc.
>
> Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
> ---
> arch/s390/mm/gmap_helpers.c | 2 +-
> drivers/android/binder/page_range.rs | 4 ++--
> drivers/android/binder_alloc.c | 2 +-
> include/linux/mm.h | 4 ++--
> kernel/bpf/arena.c | 2 +-
> kernel/events/core.c | 2 +-
> mm/madvise.c | 4 ++--
> mm/memory.c | 14 +++++++-------
> net/ipv4/tcp.c | 6 +++---
> rust/kernel/mm/virt.rs | 4 ++--
> 10 files changed, 22 insertions(+), 22 deletions(-)
>
> diff --git a/arch/s390/mm/gmap_helpers.c b/arch/s390/mm/gmap_helpers.c
> index ae2d59a19313..f8789ffcc05c 100644
> --- a/arch/s390/mm/gmap_helpers.c
> +++ b/arch/s390/mm/gmap_helpers.c
> @@ -89,7 +89,7 @@ void gmap_helper_discard(struct mm_struct *mm, unsigned long vmaddr, unsigned lo
> if (!vma)
> return;
> if (!is_vm_hugetlb_page(vma))
> - zap_page_range_single(vma, vmaddr, min(end, vma->vm_end) - vmaddr);
> + zap_vma_range(vma, vmaddr, min(end, vma->vm_end) - vmaddr);
> vmaddr = vma->vm_end;
> }
> }
> diff --git a/drivers/android/binder/page_range.rs b/drivers/android/binder/page_range.rs
> index fdd97112ef5c..2fddd4ed8d4c 100644
> --- a/drivers/android/binder/page_range.rs
> +++ b/drivers/android/binder/page_range.rs
> @@ -130,7 +130,7 @@ pub(crate) struct ShrinkablePageRange {
> pid: Pid,
> /// The mm for the relevant process.
> mm: ARef<Mm>,
> - /// Used to synchronize calls to `vm_insert_page` and `zap_page_range_single`.
> + /// Used to synchronize calls to `vm_insert_page` and `zap_vma_range`.
> #[pin]
> mm_lock: Mutex<()>,
> /// Spinlock protecting changes to pages.
> @@ -719,7 +719,7 @@ fn drop(self: Pin<&mut Self>) {
>
> if let Some(vma) = mmap_read.vma_lookup(vma_addr) {
> let user_page_addr = vma_addr + (page_index << PAGE_SHIFT);
> - vma.zap_page_range_single(user_page_addr, PAGE_SIZE);
> + vma.zap_vma_range(user_page_addr, PAGE_SIZE);
> }
>
> drop(mmap_read);
> diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c
> index dd2046bd5cde..e4488ad86a65 100644
> --- a/drivers/android/binder_alloc.c
> +++ b/drivers/android/binder_alloc.c
> @@ -1185,7 +1185,7 @@ enum lru_status binder_alloc_free_page(struct list_head *item,
> if (vma) {
> trace_binder_unmap_user_start(alloc, index);
>
> - zap_page_range_single(vma, page_addr, PAGE_SIZE);
> + zap_vma_range(vma, page_addr, PAGE_SIZE);
>
> trace_binder_unmap_user_end(alloc, index);
> }
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index 4bd1500b9630..833bedd3f739 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -2835,7 +2835,7 @@ struct page *vm_normal_page_pud(struct vm_area_struct *vma, unsigned long addr,
>
> void zap_vma_ptes(struct vm_area_struct *vma, unsigned long address,
> unsigned long size);
> -void zap_page_range_single(struct vm_area_struct *vma, unsigned long address,
> +void zap_vma_range(struct vm_area_struct *vma, unsigned long address,
> unsigned long size);
> /**
> * zap_vma - zap all page table entries in a vma
> @@ -2843,7 +2843,7 @@ void zap_page_range_single(struct vm_area_struct *vma, unsigned long address,
> */
> static inline void zap_vma(struct vm_area_struct *vma)
> {
> - zap_page_range_single(vma, vma->vm_start, vma->vm_end - vma->vm_start);
> + zap_vma_range(vma, vma->vm_start, vma->vm_end - vma->vm_start);
> }
> struct mmu_notifier_range;
>
> diff --git a/kernel/bpf/arena.c b/kernel/bpf/arena.c
> index c34510d83b1f..37843c6a4764 100644
> --- a/kernel/bpf/arena.c
> +++ b/kernel/bpf/arena.c
> @@ -656,7 +656,7 @@ static void zap_pages(struct bpf_arena *arena, long uaddr, long page_cnt)
> guard(mutex)(&arena->lock);
> /* iterate link list under lock */
> list_for_each_entry(vml, &arena->vma_list, head)
> - zap_page_range_single(vml->vma, uaddr, PAGE_SIZE * page_cnt);
> + zap_vma_range(vml->vma, uaddr, PAGE_SIZE * page_cnt);
> }

Acked-by: Puranjay Mohan <puranjay@kernel.org>