Thread (81 messages) 81 messages, 3 authors, 7d ago

Re: [PATCH v5 25/38] mm: remove VMA_IO_BIT check in vma[_flags]_is_mm_managed()

flat view

From: "Lorenzo Stoakes (ARM)" <ljs@kernel.org>
Date: 2026-10-12 18:42:48
Also in: bpf, dri-devel, fuse-devel, kvm, kvm-riscv, kvmarm, linux-arch, linux-doc, linux-fsdevel, linux-mm, linux-perf-users, linux-rdma, linux-riscv, linux-s390, linux-scsi, linux-sound, linux-trace-kernel, linux-usb, linuxppc-dev, lkml, selinux, sparclinux

On Mon, Oct 12, 2026 at 08:31:59PM +0200, David Hildenbrand (Arm) wrote:
On 10/9/26 20:04, Lorenzo Stoakes (ARM) wrote:
quoted
We have now made it such that every driver which sets VMA_IO_BIT marks it
as not mm-managed.
Confusing given that mm-managed check tests VMA_IO_BIT.
Yeah, true.

Getting rid of that is a really nice improvement to understanding in general...
Maybe combining this with the next paragraph could make this easier to grasp

"vma_flags_is_mm_managed() still checks for VMA_IO_BIT, and if set, treats it as
non-mm-managed. This was previously required to handle driver that would set
VMA_IO_BIT but none of the other flags that would indicate a VMA as non-mm-managed.

We already established now that a driver that sets VMA_IO_BIT must set one of
the other VMA flags that allow for identifying it as non-mm-managed.

...
"
Ack, will update to something like this.
quoted
--- a/mm/vma.c
+++ b/mm/vma.c
@@ -2796,7 +2796,7 @@ static int mmap_validate_vma_flags(const vma_flags_t *flags)
 		return -EINVAL;
 #endif

-	if (!vma_flags_test_any(flags, VMA_PFNMAP_BIT, VMA_MIXEDMAP_BIT)) {
+	if (vma_flags_is_mm_managed(flags)) {
Ah, there is the change.
Yup! Was an annoying dance to have to do.
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Thanks!

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