Re: [PATCH v1 02/16] mm/memory: remove "zap_details" parameter from zap_page_range_single()

Puranjay Mohan
2026-03-09T16:44:20Z

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

> Nobody except memory.c should really set that parameter to non-NULL. So
> let's just drop it and make unmap_mapping_range_vma() use
> zap_page_range_single_batched() instead.
>
> Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
> ---
> arch/s390/mm/gmap_helpers.c | 2 +-
> drivers/android/binder_alloc.c | 2 +-
> include/linux/mm.h | 5 ++---
> kernel/bpf/arena.c | 3 +--
> kernel/events/core.c | 2 +-
> mm/madvise.c | 3 +--
> mm/memory.c | 16 ++++++++++------
> net/ipv4/tcp.c | 5 ++---
> rust/kernel/mm/virt.rs | 2 +-
> 9 files changed, 20 insertions(+), 20 deletions(-)
>
> diff --git a/arch/s390/mm/gmap_helpers.c b/arch/s390/mm/gmap_helpers.c
> index dea83e3103e5..ae2d59a19313 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, NULL);
> + zap_page_range_single(vma, vmaddr, min(end, vma->vm_end) - vmaddr);
> vmaddr = vma->vm_end;
> }
> }
> diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c
> index 241f16a9b63d..dd2046bd5cde 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, NULL);
> + zap_page_range_single(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 ecff8268089b..a8138ff7d1fa 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -2835,11 +2835,10 @@ 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,
> - unsigned long size, struct zap_details *details);
> + unsigned long size);
> static inline void zap_vma_pages(struct vm_area_struct *vma)
> {
> - zap_page_range_single(vma, vma->vm_start,
> - vma->vm_end - vma->vm_start, NULL);
> + zap_page_range_single(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 144f30e740e8..c34510d83b1f 100644
> --- a/kernel/bpf/arena.c
> +++ b/kernel/bpf/arena.c
> @@ -656,8 +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, NULL);
> + zap_page_range_single(vml->vma, uaddr, PAGE_SIZE * page_cnt);
> }

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