Thread (29 messages) 29 messages, 4 authors, 23h ago

Re: [PATCH v2 13/13] mm/mremap: convert mremap code to use vma_flags_t

From: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>
Date: 2026-07-22 16:15:36
Also in: dri-devel, intel-gfx, intel-xe, linux-arm-msm, linux-fsdevel, linux-mips, linux-mm, linux-samsung-soc, linux-sound, linux-tegra, linuxppc-dev, lkml, nouveau, virtualization, xen-devel

On 7/11/26 20:45, Lorenzo Stoakes wrote:
Replace use of the legacy vm_flags_t flags with vma_flags_t values
throughout the mremap logic.

Note that, in replacing vm_flags_clear() (which takes the VMA write lock)
with vma_clear_flags() and vma_clear_flags_mask() (which do not)
respectively in unmap_source_vma() and dontunmap_complete(), we do not add
a VMA write lock to account for htis.

This is because, in both cases, move_vma() is their calling function and
this has already acquired the VMA write lock on vrm->vma whose VMA flags
are being cleared.

In the case of vma_set_flags() in unmap_source_vma() we do need to do this
- as prev and next were not necessarily write locked at this point.

Additionally update comments to reflect the changes to be consistent.

No functional change intended.

Reviewed-by: Zi Yan <ziy@nvidia.com>
Signed-off-by: Lorenzo Stoakes <ljs@kernel.org>
Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help