Thread (34 messages) 34 messages, 6 authors, 2023-01-26

Re: [PATCH v2 3/6] mm: replace vma->vm_flags direct modifications with modifier calls

From: Suren Baghdasaryan <surenb@google.com>
Date: 2023-01-25 16:56:03
Also in: alsa-devel, amd-gfx, bpf, dmaengine, dri-devel, intel-gfx, kexec, kvm, linux-acpi, linux-arch, linux-arm-msm, linux-crypto, linux-ext4, linux-fbdev, linux-fsdevel, linux-media, linux-mediatek, linux-mm, linux-perf-users, linux-rdma, linux-s390, linux-samsung-soc, linux-scsi, linux-staging, linux-tegra, linux-um, linux-usb, linux-xfs, lkml, loongarch, netdev, nvdimm, selinux, sparclinux, target-devel, xen-devel

On Wed, Jan 25, 2023 at 1:30 AM 'Michal Hocko' via kernel-team
[off-list ref] wrote:
On Wed 25-01-23 00:38:48, Suren Baghdasaryan wrote:
quoted
Replace direct modifications to vma->vm_flags with calls to modifier
functions to be able to track flag changes and to keep vma locking
correctness.
Is this a manual (git grep) based work or have you used Coccinele for
the patch generation?
It was a manual "search and replace" and in the process I temporarily
renamed vm_flags to ensure I did not miss any usage.
My potentially incomplete check
$ git grep ">[[:space:]]*vm_flags[[:space:]]*[&|^]="

shows that nothing should be left after this. There is still quite a lot
of direct checks of the flags (more than 600). Maybe it would be good to
make flags accessible only via accessors which would also prevent any
future direct setting of those flags in uncontrolled way as well.
Yes, I think Peter's suggestion in the first patch would also require
that. Much more churn but probably worth it for the future
maintenance. I'll add a patch which converts all readers as well.
Anyway
Acked-by: Michal Hocko <mhocko@suse.com>
Thanks for all the reviews!
--
Michal Hocko
SUSE Labs

--
To unsubscribe from this group and stop receiving emails from it, send an email to kernel-team+unsubscribe@android.com.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help