[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 1/6] mm: introduce vma->vm_flags modifier functions
- To: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
- From: Suren Baghdasaryan <surenb@xxxxxxxxxx>
- Date: Wed, 25 Jan 2023 08:49:50 -0800
- Cc: akpm@xxxxxxxxxxxxxxxxxxxx, michel@xxxxxxxxxxxxxx, jglisse@xxxxxxxxxx, mhocko@xxxxxxxx, vbabka@xxxxxxx, hannes@xxxxxxxxxxx, mgorman@xxxxxxxxxxxxxxxxxxx, dave@xxxxxxxxxxxx, willy@xxxxxxxxxxxxx, liam.howlett@xxxxxxxxxx, ldufour@xxxxxxxxxxxxx, paulmck@xxxxxxxxxx, luto@xxxxxxxxxx, songliubraving@xxxxxx, peterx@xxxxxxxxxx, david@xxxxxxxxxx, dhowells@xxxxxxxxxx, hughd@xxxxxxxxxx, bigeasy@xxxxxxxxxxxxx, kent.overstreet@xxxxxxxxx, punit.agrawal@xxxxxxxxxxxxx, lstoakes@xxxxxxxxx, peterjung1337@xxxxxxxxx, rientjes@xxxxxxxxxx, axelrasmussen@xxxxxxxxxx, joelaf@xxxxxxxxxx, minchan@xxxxxxxxxx, jannh@xxxxxxxxxx, shakeelb@xxxxxxxxxx, tatashin@xxxxxxxxxx, edumazet@xxxxxxxxxx, gthelen@xxxxxxxxxx, gurua@xxxxxxxxxx, arjunroy@xxxxxxxxxx, soheil@xxxxxxxxxx, hughlynch@xxxxxxxxxx, leewalsh@xxxxxxxxxx, posk@xxxxxxxxxx, will@xxxxxxxxxx, aneesh.kumar@xxxxxxxxxxxxx, npiggin@xxxxxxxxx, chenhuacai@xxxxxxxxxx, tglx@xxxxxxxxxxxxx, mingo@xxxxxxxxxx, bp@xxxxxxxxx, dave.hansen@xxxxxxxxxxxxxxx, richard@xxxxxx, anton.ivanov@xxxxxxxxxxxxxxxxxx, johannes@xxxxxxxxxxxxxxxx, qianweili@xxxxxxxxxx, wangzhou1@xxxxxxxxxxxxx, herbert@xxxxxxxxxxxxxxxxxxx, davem@xxxxxxxxxxxxx, vkoul@xxxxxxxxxx, airlied@xxxxxxxxx, daniel@xxxxxxxx, maarten.lankhorst@xxxxxxxxxxxxxxx, mripard@xxxxxxxxxx, tzimmermann@xxxxxxx, l.stach@xxxxxxxxxxxxxx, krzysztof.kozlowski@xxxxxxxxxx, patrik.r.jakobsson@xxxxxxxxx, matthias.bgg@xxxxxxxxx, robdclark@xxxxxxxxx, quic_abhinavk@xxxxxxxxxxx, dmitry.baryshkov@xxxxxxxxxx, tomba@xxxxxxxxxx, hjc@xxxxxxxxxxxxxx, heiko@xxxxxxxxx, ray.huang@xxxxxxx, kraxel@xxxxxxxxxx, sre@xxxxxxxxxx, mcoquelin.stm32@xxxxxxxxx, alexandre.torgue@xxxxxxxxxxx, tfiga@xxxxxxxxxxxx, m.szyprowski@xxxxxxxxxxx, mchehab@xxxxxxxxxx, dimitri.sivanich@xxxxxxx, zhangfei.gao@xxxxxxxxxx, jejb@xxxxxxxxxxxxx, martin.petersen@xxxxxxxxxx, dgilbert@xxxxxxxxxxxx, hdegoede@xxxxxxxxxx, mst@xxxxxxxxxx, jasowang@xxxxxxxxxx, alex.williamson@xxxxxxxxxx, deller@xxxxxx, jayalk@xxxxxxxxxxxx, viro@xxxxxxxxxxxxxxxxxx, nico@xxxxxxxxxxx, xiang@xxxxxxxxxx, chao@xxxxxxxxxx, tytso@xxxxxxx, adilger.kernel@xxxxxxxxx, miklos@xxxxxxxxxx, mike.kravetz@xxxxxxxxxx, muchun.song@xxxxxxxxx, bhe@xxxxxxxxxx, andrii@xxxxxxxxxx, yoshfuji@xxxxxxxxxxxxxx, dsahern@xxxxxxxxxx, kuba@xxxxxxxxxx, pabeni@xxxxxxxxxx, perex@xxxxxxxx, tiwai@xxxxxxxx, haojian.zhuang@xxxxxxxxx, robert.jarzmik@xxxxxxx, linux-mm@xxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, x86@xxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, linux-graphics-maintainer@xxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, linux-arch@xxxxxxxxxxxxxxx, loongarch@xxxxxxxxxxxxxxx, kvm@xxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, linux-sgx@xxxxxxxxxxxxxxx, linux-um@xxxxxxxxxxxxxxxxxxx, linux-acpi@xxxxxxxxxxxxxxx, linux-crypto@xxxxxxxxxxxxxxx, nvdimm@xxxxxxxxxxxxxxx, dmaengine@xxxxxxxxxxxxxxx, amd-gfx@xxxxxxxxxxxxxxxxxxxxx, dri-devel@xxxxxxxxxxxxxxxxxxxxx, etnaviv@xxxxxxxxxxxxxxxxxxxxx, linux-samsung-soc@xxxxxxxxxxxxxxx, intel-gfx@xxxxxxxxxxxxxxxxxxxxx, linux-mediatek@xxxxxxxxxxxxxxxxxxx, linux-arm-msm@xxxxxxxxxxxxxxx, freedreno@xxxxxxxxxxxxxxxxxxxxx, linux-rockchip@xxxxxxxxxxxxxxxxxxx, linux-tegra@xxxxxxxxxxxxxxx, virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-stm32@xxxxxxxxxxxxxxxxxxxxxxxxxxxx, linux-rdma@xxxxxxxxxxxxxxx, linux-media@xxxxxxxxxxxxxxx, linux-accelerators@xxxxxxxxxxxxxxxx, sparclinux@xxxxxxxxxxxxxxx, linux-scsi@xxxxxxxxxxxxxxx, linux-staging@xxxxxxxxxxxxxxx, target-devel@xxxxxxxxxxxxxxx, linux-usb@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxxxxxx, linux-fbdev@xxxxxxxxxxxxxxx, linux-aio@xxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, linux-erofs@xxxxxxxxxxxxxxxx, linux-ext4@xxxxxxxxxxxxxxx, devel@xxxxxxxxxxxxxxxxxx, kexec@xxxxxxxxxxxxxxxxxxx, linux-xfs@xxxxxxxxxxxxxxx, bpf@xxxxxxxxxxxxxxx, linux-perf-users@xxxxxxxxxxxxxxx, kasan-dev@xxxxxxxxxxxxxxxx, selinux@xxxxxxxxxxxxxxx, alsa-devel@xxxxxxxxxxxxxxxx, kernel-team@xxxxxxxxxxx
- Delivery-date: Thu, 26 Jan 2023 05:08:40 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Wed, Jan 25, 2023 at 1:10 AM Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
>
> On Wed, Jan 25, 2023 at 12:38:46AM -0800, Suren Baghdasaryan wrote:
>
> > diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
> > index 2d6d790d9bed..6c7c70bf50dd 100644
> > --- a/include/linux/mm_types.h
> > +++ b/include/linux/mm_types.h
> > @@ -491,7 +491,13 @@ struct vm_area_struct {
> > * See vmf_insert_mixed_prot() for discussion.
> > */
> > pgprot_t vm_page_prot;
> > - unsigned long vm_flags; /* Flags, see mm.h. */
> > +
> > + /*
> > + * Flags, see mm.h.
> > + * WARNING! Do not modify directly.
> > + * Use {init|reset|set|clear|mod}_vm_flags() functions instead.
> > + */
> > + unsigned long vm_flags;
>
> We have __private and ACCESS_PRIVATE() to help with enforcing this.
Thanks for pointing this out, Peter! I guess for that I'll need to
convert all read accesses and provide get_vm_flags() too? That will
cause some additional churt (a quick search shows 801 hits over 248
files) but maybe it's worth it? I think Michal suggested that too in
another patch. Should I do that while we are at it?
>
|