Thread (60 messages) flat view 60 messages, 8 authors, 2026-03-11

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

From: "David Hildenbrand (Arm)" <david@kernel.org>
Date: 2026-03-02 08:19:05
Also in: bpf, dri-devel, intel-gfx, kvm, linux-fsdevel, linux-mm, linux-perf-users, linux-rdma, linux-s390, lkml, netdev, rust-for-linux
Subsystem: memory management - rust, rust, the rest · Maintainers: Alice Ryhl, Miguel Ojeda, Linus Torvalds

On 2/28/26 13:38, Alice Ryhl wrote:
On Fri, Feb 27, 2026 at 09:08:33PM +0100, David Hildenbrand (Arm) wrote:
quoted
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>
quoted
diff --git a/rust/kernel/mm/virt.rs b/rust/kernel/mm/virt.rs
index da21d65ccd20..b8e59e4420f3 100644
--- a/rust/kernel/mm/virt.rs
+++ b/rust/kernel/mm/virt.rs
@@ -124,7 +124,7 @@ pub fn zap_page_range_single(&self, address: usize, size: usize) {
         // sufficient for this method call. This method has no requirements on the vma flags. The
         // address range is checked to be within the vma.
         unsafe {
-            bindings::zap_page_range_single(self.as_ptr(), address, size, core::ptr::null_mut())
+            bindings::zap_page_range_single(self.as_ptr(), address, size)
         };
Please run rustfmt on Rust changes. Here, rustfmt leads to this being
formatted on a single line:
Having to run tooling I don't even have installed when removing a single
function parameter; did not expect that :)
unsafe { bindings::zap_page_range_single(self.as_ptr(), address, size) };
@Andrew, can you squash:

From 5128f2e34d219722a8883c1fa94e057bd34601f2 Mon Sep 17 00:00:00 2001
From: "David Hildenbrand (Arm)" <david@kernel.org>
Date: Mon, 2 Mar 2026 09:17:19 +0100
Subject: [PATCH] fixup: mm/memory: remove zap_details parameter from
 zap_page_range_single()

Signed-off-by: David Hildenbrand (Arm) <david@kernel.org>
---
 rust/kernel/mm/virt.rs | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/rust/kernel/mm/virt.rs b/rust/kernel/mm/virt.rs
index b8e59e4420f3..6bfd91cfa1f4 100644
--- a/rust/kernel/mm/virt.rs
+++ b/rust/kernel/mm/virt.rs
@@ -123,9 +123,7 @@ pub fn zap_page_range_single(&self, address: usize, size: usize) {
         // SAFETY: By the type invariants, the caller has read access to this VMA, which is
         // sufficient for this method call. This method has no requirements on the vma flags. The
         // address range is checked to be within the vma.
-        unsafe {
-            bindings::zap_page_range_single(self.as_ptr(), address, size)
-        };
+        unsafe { bindings::zap_page_range_single(self.as_ptr(), address, size) };
     }
 
     /// If the [`VM_MIXEDMAP`] flag is set, returns a [`VmaMixedMap`] to this VMA, otherwise
-- 
2.43.0



> with the above changed:
> 
> Acked-by: Alice Ryhl <aliceryhl@google.com> # Rust and Binder

Thanks!

-- 
Cheers,

David
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help