[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <nt4vh2sny6xzfuebs4wvpzhscror6eqn6cliqgrlpkpa55ybsu@kixld3vioh2u>
Date: Mon, 9 Feb 2026 18:40:19 +0000
From: "Liam R. Howlett" <Liam.Howlett@...cle.com>
To: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
Jarkko Sakkinen <jarkko@...nel.org>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Thomas Gleixner <tglx@...nel.org>, Ingo Molnar <mingo@...hat.com>,
Borislav Petkov <bp@...en8.de>, x86@...nel.org,
"H . Peter Anvin" <hpa@...or.com>, Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Dan Williams <dan.j.williams@...el.com>,
Vishal Verma <vishal.l.verma@...el.com>,
Dave Jiang <dave.jiang@...el.com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
Jani Nikula <jani.nikula@...ux.intel.com>,
Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@...el.com>,
Tvrtko Ursulin <tursulin@...ulin.net>,
Christian Koenig <christian.koenig@....com>,
Huang Rui <ray.huang@....com>, Matthew Auld <matthew.auld@...el.com>,
Matthew Brost <matthew.brost@...el.com>,
Alexander Viro <viro@...iv.linux.org.uk>,
Christian Brauner <brauner@...nel.org>, Jan Kara <jack@...e.cz>,
Benjamin LaHaise <bcrl@...ck.org>, Gao Xiang <xiang@...nel.org>,
Chao Yu <chao@...nel.org>, Yue Hu <zbestahu@...il.com>,
Jeffle Xu <jefflexu@...ux.alibaba.com>,
Sandeep Dhavale <dhavale@...gle.com>,
Hongbo Li <lihongbo22@...wei.com>, Chunhai Guo <guochunhai@...o.com>,
Theodore Ts'o <tytso@....edu>,
Andreas Dilger <adilger.kernel@...ger.ca>,
Muchun Song <muchun.song@...ux.dev>,
Oscar Salvador <osalvador@...e.de>,
David Hildenbrand <david@...nel.org>,
Konstantin Komarov <almaz.alexandrovich@...agon-software.com>,
Mike Marshall <hubcap@...ibond.com>,
Martin Brandenburg <martin@...ibond.com>,
Tony Luck <tony.luck@...el.com>,
Reinette Chatre <reinette.chatre@...el.com>,
Dave Martin <Dave.Martin@....com>, James Morse <james.morse@....com>,
Babu Moger <babu.moger@....com>, Carlos Maiolino <cem@...nel.org>,
Damien Le Moal <dlemoal@...nel.org>,
Naohiro Aota <naohiro.aota@....com>,
Johannes Thumshirn <jth@...nel.org>,
Matthew Wilcox <willy@...radead.org>, Vlastimil Babka <vbabka@...e.cz>,
Mike Rapoport <rppt@...nel.org>,
Suren Baghdasaryan <surenb@...gle.com>, Michal Hocko <mhocko@...e.com>,
Hugh Dickins <hughd@...gle.com>,
Baolin Wang <baolin.wang@...ux.alibaba.com>, Zi Yan <ziy@...dia.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>, Jann Horn <jannh@...gle.com>,
Pedro Falcato <pfalcato@...e.de>, David Howells <dhowells@...hat.com>,
Paul Moore <paul@...l-moore.com>, James Morris <jmorris@...ei.org>,
"Serge E . Hallyn" <serge@...lyn.com>,
Yury Norov <yury.norov@...il.com>,
Rasmus Villemoes <linux@...musvillemoes.dk>, linux-sgx@...r.kernel.org,
linux-kernel@...r.kernel.org, nvdimm@...ts.linux.dev,
linux-cxl@...r.kernel.org, dri-devel@...ts.freedesktop.org,
intel-gfx@...ts.freedesktop.org, linux-fsdevel@...r.kernel.org,
linux-aio@...ck.org, linux-erofs@...ts.ozlabs.org,
linux-ext4@...r.kernel.org, linux-mm@...ck.org, ntfs3@...ts.linux.dev,
devel@...ts.orangefs.org, linux-xfs@...r.kernel.org,
keyrings@...r.kernel.org, linux-security-module@...r.kernel.org,
Jason Gunthorpe <jgg@...dia.com>
Subject: Re: [PATCH v2 02/13] mm: rename vma_flag_test/set_atomic() to
vma_test/set_atomic_flag()
* Lorenzo Stoakes <lorenzo.stoakes@...cle.com> [260122 16:06]:
> In order to stay consistent between functions which manipulate a vm_flags_t
> argument of the form of vma_flags_...() and those which manipulate a
> VMA (in this case the flags field of a VMA), rename
> vma_flag_[test/set]_atomic() to vma_[test/set]_atomic_flag().
>
> This lays the groundwork for adding VMA flag manipulation functions in a
> subsequent commit.
>
> Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
Reviewed-by: Liam R. Howlett <Liam.Howlett@...cle.com>
> ---
> include/linux/mm.h | 13 +++++--------
> mm/khugepaged.c | 2 +-
> mm/madvise.c | 2 +-
> 3 files changed, 7 insertions(+), 10 deletions(-)
>
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index 776a7e03f88b..e0d31238097c 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -987,8 +987,7 @@ static inline void vm_flags_mod(struct vm_area_struct *vma,
> __vm_flags_mod(vma, set, clear);
> }
>
> -static inline bool __vma_flag_atomic_valid(struct vm_area_struct *vma,
> - vma_flag_t bit)
> +static inline bool __vma_atomic_valid_flag(struct vm_area_struct *vma, vma_flag_t bit)
> {
> const vm_flags_t mask = BIT((__force int)bit);
>
> @@ -1003,13 +1002,12 @@ static inline bool __vma_flag_atomic_valid(struct vm_area_struct *vma,
> * Set VMA flag atomically. Requires only VMA/mmap read lock. Only specific
> * valid flags are allowed to do this.
> */
> -static inline void vma_flag_set_atomic(struct vm_area_struct *vma,
> - vma_flag_t bit)
> +static inline void vma_set_atomic_flag(struct vm_area_struct *vma, vma_flag_t bit)
> {
> unsigned long *bitmap = vma->flags.__vma_flags;
>
> vma_assert_stabilised(vma);
> - if (__vma_flag_atomic_valid(vma, bit))
> + if (__vma_atomic_valid_flag(vma, bit))
> set_bit((__force int)bit, bitmap);
> }
>
> @@ -1020,10 +1018,9 @@ static inline void vma_flag_set_atomic(struct vm_area_struct *vma,
> * This is necessarily racey, so callers must ensure that serialisation is
> * achieved through some other means, or that races are permissible.
> */
> -static inline bool vma_flag_test_atomic(struct vm_area_struct *vma,
> - vma_flag_t bit)
> +static inline bool vma_test_atomic_flag(struct vm_area_struct *vma, vma_flag_t bit)
> {
> - if (__vma_flag_atomic_valid(vma, bit))
> + if (__vma_atomic_valid_flag(vma, bit))
> return test_bit((__force int)bit, &vma->vm_flags);
>
> return false;
> diff --git a/mm/khugepaged.c b/mm/khugepaged.c
> index fba6aea5bea6..e76f42243534 100644
> --- a/mm/khugepaged.c
> +++ b/mm/khugepaged.c
> @@ -1741,7 +1741,7 @@ static bool file_backed_vma_is_retractable(struct vm_area_struct *vma)
> * obtained on guard region installation after the flag is set, so this
> * check being performed under this lock excludes races.
> */
> - if (vma_flag_test_atomic(vma, VMA_MAYBE_GUARD_BIT))
> + if (vma_test_atomic_flag(vma, VMA_MAYBE_GUARD_BIT))
> return false;
>
> return true;
> diff --git a/mm/madvise.c b/mm/madvise.c
> index 1f3040688f04..8debb2d434aa 100644
> --- a/mm/madvise.c
> +++ b/mm/madvise.c
> @@ -1140,7 +1140,7 @@ static long madvise_guard_install(struct madvise_behavior *madv_behavior)
> * acquire an mmap/VMA write lock to read it. All remaining readers may
> * or may not see the flag set, but we don't care.
> */
> - vma_flag_set_atomic(vma, VMA_MAYBE_GUARD_BIT);
> + vma_set_atomic_flag(vma, VMA_MAYBE_GUARD_BIT);
>
> /*
> * If anonymous and we are establishing page tables the VMA ought to
> --
> 2.52.0
>
Powered by blists - more mailing lists