[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAH5fLggUzj532WOuHjx0Uz97eiRVSpJ-xtCwiP6h1g_Rg3WoPQ@mail.gmail.com>
Date: Tue, 13 Jan 2026 20:31:11 +0100
From: Alice Ryhl <aliceryhl@...gle.com>
To: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
Cc: Chris Mason <clm@...a.com>, Andrew Morton <akpm@...ux-foundation.org>,
Oscar Salvador <osalvador@...e.de>, David Hildenbrand <david@...hat.com>,
"Liam R . Howlett" <Liam.Howlett@...cle.com>, Vlastimil Babka <vbabka@...e.cz>,
Mike Rapoport <rppt@...nel.org>, Suren Baghdasaryan <surenb@...gle.com>, Michal Hocko <mhocko@...e.com>,
Axel Rasmussen <axelrasmussen@...gle.com>, Yuanchu Xie <yuanchu@...gle.com>,
Wei Xu <weixugc@...gle.com>, Peter Xu <peterx@...hat.com>, Ingo Molnar <mingo@...hat.com>,
Peter Zijlstra <peterz@...radead.org>, Juri Lelli <juri.lelli@...hat.com>,
Vincent Guittot <vincent.guittot@...aro.org>, Dietmar Eggemann <dietmar.eggemann@....com>,
Steven Rostedt <rostedt@...dmis.org>, Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
Valentin Schneider <vschneid@...hat.com>, Kees Cook <kees@...nel.org>,
Matthew Wilcox <willy@...radead.org>, Jason Gunthorpe <jgg@...pe.ca>, John Hubbard <jhubbard@...dia.com>,
Leon Romanovsky <leon@...nel.org>, Zi Yan <ziy@...dia.com>,
Baolin Wang <baolin.wang@...ux.alibaba.com>, Nico Pache <npache@...hat.com>,
Ryan Roberts <ryan.roberts@....com>, Dev Jain <dev.jain@....com>, Barry Song <baohua@...nel.org>,
Lance Yang <lance.yang@...ux.dev>, Xu Xin <xu.xin16@....com.cn>,
Chengming Zhou <chengming.zhou@...ux.dev>, Jann Horn <jannh@...gle.com>,
Matthew Brost <matthew.brost@...el.com>, Joshua Hahn <joshua.hahnjy@...il.com>,
Rakie Kim <rakie.kim@...com>, Byungchul Park <byungchul@...com>, Gregory Price <gourry@...rry.net>,
Ying Huang <ying.huang@...ux.alibaba.com>, Alistair Popple <apopple@...dia.com>,
Pedro Falcato <pfalcato@...e.de>, Shakeel Butt <shakeel.butt@...ux.dev>,
David Rientjes <rientjes@...gle.com>, Rik van Riel <riel@...riel.com>, Harry Yoo <harry.yoo@...cle.com>,
Kemeng Shi <shikemeng@...weicloud.com>, Kairui Song <kasong@...cent.com>,
Nhat Pham <nphamcs@...il.com>, Baoquan He <bhe@...hat.com>, Chris Li <chrisl@...nel.org>,
Johannes Weiner <hannes@...xchg.org>, Qi Zheng <zhengqi.arch@...edance.com>,
linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-mm@...ck.org, Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Bjorn Roy Baron <bjorn3_gh@...tonmail.com>, Benno Lossin <lossin@...nel.org>,
Andreas Hindborg <a.hindborg@...nel.org>, Trevor Gross <tmgross@...ch.edu>,
Danilo Krummrich <dakr@...nel.org>, rust-for-linux@...r.kernel.org
Subject: Re: [PATCH v3 1/4] mm: declare VMA flags by bit
On Tue, Jan 13, 2026 at 8:14 PM Lorenzo Stoakes
<lorenzo.stoakes@...cle.com> wrote:
>
> On Tue, Jan 13, 2026 at 08:02:17PM +0100, Alice Ryhl wrote:
> > On Tue, Jan 13, 2026 at 7:52 PM Chris Mason <clm@...a.com> wrote:
> > >
> > > On Tue, 25 Nov 2025 10:00:59 +0000 Lorenzo Stoakes <lorenzo.stoakes@...cle.com> wrote:
> > >
> > > [ ... ]
> > > >
> > > > Finally, we update the rust binding helper as now it cannot auto-detect the
> > > > flags at all.
> > > >
> > >
> > > I did a run of all the MM commits from 6.18 to today's linus, and this one
> > > had a copy/paste error. I'd normally just send a patch for this, but in
> > > terms of showing the review output:
> > >
> > > > diff --git a/rust/bindings/bindings_helper.h b/rust/bindings/bindings_helper.h
> > > > index 2e43c66635a2c..4c327db01ca03 100644
> > > > --- a/rust/bindings/bindings_helper.h
> > > > +++ b/rust/bindings/bindings_helper.h
> > > > @@ -108,7 +108,32 @@ const xa_mark_t RUST_CONST_HELPER_XA_PRESENT = XA_PRESENT;
> > >
> > > [ ... ]
> > >
> > > > +const vm_flags_t RUST_CONST_HELPER_VM_MAYREAD = VM_MAYREAD;
> > > > +const vm_flags_t RUST_CONST_HELPER_VM_MAYWRITE = VM_MAYWRITE;
> > > > +const vm_flags_t RUST_CONST_HELPER_VM_MAYEXEC = VM_MAYEXEC;
> > > > +const vm_flags_t RUST_CONST_HELPER_VM_MAYSHARE = VM_MAYEXEC;
> > > ^^^^^^^^^^
> > >
> > > Should this be VM_MAYSHARE instead of VM_MAYEXEC? This appears to be a
> > > copy-paste error that would cause Rust code using VmFlags::MAYSHARE to
> > > get bit 6 (VM_MAYEXEC) instead of bit 7 (VM_MAYSHARE).
> > >
> > > The pattern of the preceding lines shows each constant should reference
> > > its matching flag:
> > >
> > > RUST_CONST_HELPER_VM_MAYREAD = VM_MAYREAD
> > > RUST_CONST_HELPER_VM_MAYWRITE = VM_MAYWRITE
> > > RUST_CONST_HELPER_VM_MAYEXEC = VM_MAYEXEC
> > > RUST_CONST_HELPER_VM_MAYSHARE = VM_MAYSHARE <- expected
> > >
> > > > +const vm_flags_t RUST_CONST_HELPER_VM_PFNMAP = VM_PFNMAP;
> >
> > Uh, good catch. Do you want to send a fix patch?
>
> It's in 6.18 so would need to be a Cc: stable patch with a Fixes etc. rather
> than a fix-patch, unless that's what you meant?
That's what I meant, yeah.
Alice
Powered by blists - more mailing lists