Re: [PATCH 11/13] mm/mlock: convert mlock code to use vma_flags_t
Lorenzo Stoakes <[email protected]> Thu, 2 Jul 2026 16:47:14 +0100
| Newsgroups | gmane.comp.freedesktop.xorg.drivers.freedreno,gmane.linux.ports.mips,gmane.linux.kernel,gmane.linux.ports.ppc64.devel,gmane.comp.video.dri.devel,gmane.linux.ports.arm.kernel,gmane.linux.kernel.samsung-soc,gmane.comp.freedesktop.xorg.drivers.intel,gmane.linux.ports.arm.msm,gmane.comp.freedesktop.xorg.nouveau,gmane.linux.ports.arm.rockchip,gmane.linux.ports.tegra,gmane.comp.emulators.xen.devel,gmane.linux.kernel.aio.general,gmane.linux.file-systems,gmane.linux.kernel.mm,gmane.linux.sound |
|---|---|
| Message-ID | <akaH31jAOuMtthKF@lucifer> |
On Thu, Jul 02, 2026 at 09:21:07PM +0800, Lance Yang wrote: > > On Mon, Jun 29, 2026 at 08:25:34PM +0100, Lorenzo Stoakes wrote: > >Replace use of the legacy vm_flags_t flags with vma_flags_t values > >throughout the mlock logic. > > > >Additionally update comments to reflect the changes to be consistent. > > > >No functional change intended. > > > >Signed-off-by: Lorenzo Stoakes <[email protected]> > >--- > > Nothing scary jumped out at me. Just one tiny nit below ;) > > [...] > >@@ -466,24 +466,23 @@ static void mlock_vma_pages_range(struct vm_area_struct *vma, > > */ > > static int mlock_fixup(struct vma_iterator *vmi, struct vm_area_struct *vma, > > struct vm_area_struct **prev, unsigned long start, > >- unsigned long end, vm_flags_t newflags) > >+ unsigned long end, vma_flags_t *new_vma_flags) > > { > >- vma_flags_t new_vma_flags = legacy_to_vma_flags(newflags); > > const vma_flags_t old_vma_flags = vma->flags; > > struct mm_struct *mm = vma->vm_mm; > > int nr_pages; > > int ret = 0; > > > >- if (vma_flags_same_pair(&old_vma_flags, &new_vma_flags) || > >+ if (vma_flags_same_pair(&old_vma_flags, new_vma_flags) || > > vma_is_secretmem(vma) || !vma_supports_mlock(vma)) { > > /* > >- * Don't set VM_LOCKED or VM_LOCKONFAULT and don't count. > >+ * Don't set VMA_LOCKED_BIT or VM_LOCKONFAULT and don't count. > > s/VM_LOCKONFAULT/VMA_LOCKONFAULT_BIT/ Ah yeah oops, will fix and respin! Good spot [and claude missed it ugh] :) > > Otherwise LGTM. Feel free to add: > > Reviewed-by: Lance Yang <[email protected]> > > > * For secretmem, don't allow the memory to be unlocked. > > */ > > goto out; > > } > > > >- vma = vma_modify_flags(vmi, *prev, vma, start, end, &new_vma_flags); > >+ vma = vma_modify_flags(vmi, *prev, vma, start, end, new_vma_flags); > > if (IS_ERR(vma)) { > > ret = PTR_ERR(vma); > > goto out; > [...] Thanks, Lorenzo