From: "Lorenzo Stoakes (Oracle)" <ljs@kernel•org>
To: Andrew Morton <akpm@linux-foundation•org>
Cc: David Hildenbrand <david@kernel•org>,
"Liam R . Howlett" <Liam.Howlett@oracle•com>,
Vlastimil Babka <vbabka@kernel•org>, Jann Horn <jannh@google•com>,
Pedro Falcato <pfalcato@suse•de>, Mike Rapoport <rppt@kernel•org>,
Suren Baghdasaryan <surenb@google•com>,
Kees Cook <kees@kernel•org>,
linux-mm@kvack•org, linux-kernel@vger•kernel.org,
Vineet Gupta <vgupta@kernel•org>,
Russell King <linux@armlinux•org.uk>,
Catalin Marinas <catalin.marinas@arm•com>,
Will Deacon <will@kernel•org>, Brian Cain <bcain@kernel•org>,
Huacai Chen <chenhuacai@kernel•org>,
WANG Xuerui <kernel@xen0n•name>,
Thomas Bogendoerfer <tsbogend@alpha•franken.de>,
Dinh Nguyen <dinguyen@kernel•org>,
Madhavan Srinivasan <maddy@linux•ibm.com>,
Michael Ellerman <mpe@ellerman•id.au>,
Nicholas Piggin <npiggin@gmail•com>,
Christophe Leroy <chleroy@kernel•org>,
Paul Walmsley <pjw@kernel•org>,
Palmer Dabbelt <palmer@dabbelt•com>,
Albert Ou <aou@eecs•berkeley.edu>,
Alexandre Ghiti <alex@ghiti•fr>,
Heiko Carstens <hca@linux•ibm.com>,
Vasily Gorbik <gor@linux•ibm.com>,
Alexander Gordeev <agordeev@linux•ibm.com>,
Christian Borntraeger <borntraeger@linux•ibm.com>,
Sven Schnelle <svens@linux•ibm.com>,
Thomas Gleixner <tglx@kernel•org>, Ingo Molnar <mingo@redhat•com>,
Borislav Petkov <bp@alien8•de>,
Dave Hansen <dave.hansen@linux•intel.com>,
x86@kernel•org, "H . Peter Anvin" <hpa@zytor•com>,
Richard Weinberger <richard@nod•at>,
Anton Ivanov <anton.ivanov@cambridgegreys•com>,
Johannes Berg <johannes@sipsolutions•net>,
Alexander Viro <viro@zeniv•linux.org.uk>,
Christian Brauner <brauner@kernel•org>, Jan Kara <jack@suse•cz>,
Xu Xin <xu.xin16@zte•com.cn>,
Chengming Zhou <chengming.zhou@linux•dev>,
Michal Hocko <mhocko@suse•com>, Paul Moore <paul@paul-moore•com>,
Stephen Smalley <stephen.smalley.work@gmail•com>,
Ondrej Mosnacek <omosnace@redhat•com>,
linux-snps-arc@lists•infradead.org,
linux-arm-kernel@lists•infradead.org,
linux-hexagon@vger•kernel.org, loongarch@lists•linux.dev,
linux-mips@vger•kernel.org, linuxppc-dev@lists•ozlabs.org,
linux-riscv@lists•infradead.org, linux-s390@vger•kernel.org,
linux-um@lists•infradead.org, linux-fsdevel@vger•kernel.org,
selinux@vger•kernel.org
Subject: [PATCH v2 18/23] mm: update vma_supports_mlock() to use new VMA flags
Date: Mon, 16 Mar 2026 13:08:07 +0000 [thread overview]
Message-ID: <2f82b5b93599e89b391ee4672928cefdfd2fb2f8.1773665966.git.ljs@kernel.org> (raw)
In-Reply-To: <cover.1773665966.git.ljs@kernel.org>
We now have the ability to test all of this using the new vma_flags_t
approach, so let's do so.
Signed-off-by: Lorenzo Stoakes (Oracle) <ljs@kernel•org>
---
mm/internal.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/mm/internal.h b/mm/internal.h
index 80d8651441a7..708d240b4198 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -1252,7 +1252,9 @@ static inline struct file *maybe_unlock_mmap_for_io(struct vm_fault *vmf,
static inline bool vma_supports_mlock(const struct vm_area_struct *vma)
{
- if (vma->vm_flags & (VM_SPECIAL | VM_DROPPABLE))
+ if (vma_test_any_mask(vma, VMA_SPECIAL_FLAGS))
+ return false;
+ if (vma_test_single_mask(vma, VMA_DROPPABLE))
return false;
if (vma_is_dax(vma) || is_vm_hugetlb_page(vma))
return false;
--
2.53.0
next prev parent reply other threads:[~2026-03-16 13:11 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-16 13:07 [PATCH v2 00/23] mm/vma: convert vm_flags_t to vma_flags_t in vma code Lorenzo Stoakes (Oracle)
2026-03-16 13:07 ` [PATCH v2 01/23] mm/vma: add vma_flags_empty(), vma_flags_and(), vma_flags_diff_pair() Lorenzo Stoakes (Oracle)
2026-03-18 14:40 ` Vlastimil Babka (SUSE)
2026-03-19 16:50 ` Lorenzo Stoakes (Oracle)
2026-03-16 13:07 ` [PATCH v2 02/23] tools/testing/vma: add unit tests flag empty, diff_pair, and[_mask] Lorenzo Stoakes (Oracle)
2026-03-16 13:07 ` [PATCH v2 03/23] mm/vma: add further vma_flags_t unions Lorenzo Stoakes (Oracle)
2026-03-18 14:42 ` Vlastimil Babka (SUSE)
2026-03-16 13:07 ` [PATCH v2 04/23] tools/testing/vma: convert bulk of test code to vma_flags_t Lorenzo Stoakes (Oracle)
2026-03-16 13:07 ` [PATCH v2 05/23] mm/vma: use new VMA flags for sticky flags logic Lorenzo Stoakes (Oracle)
2026-03-16 13:07 ` [PATCH v2 06/23] tools/testing/vma: fix VMA flag tests Lorenzo Stoakes (Oracle)
2026-03-16 13:07 ` [PATCH v2 07/23] mm/vma: add append_vma_flags() helper Lorenzo Stoakes (Oracle)
2026-03-16 13:07 ` [PATCH v2 08/23] tools/testing/vma: add simple test for append_vma_flags() Lorenzo Stoakes (Oracle)
2026-03-16 13:07 ` [PATCH v2 09/23] mm: unexport vm_brk_flags() and eliminate vm_flags parameter Lorenzo Stoakes (Oracle)
2026-03-16 13:07 ` [PATCH v2 10/23] mm/vma: introduce vma_flags_same[_mask/_pair]() Lorenzo Stoakes (Oracle)
2026-03-16 13:08 ` [PATCH v2 11/23] mm/vma: introduce [vma_flags,legacy]_to_[legacy,vma_flags]() helpers Lorenzo Stoakes (Oracle)
2026-03-16 13:08 ` [PATCH v2 12/23] tools/testing/vma: test that legacy flag helpers work correctly Lorenzo Stoakes (Oracle)
2026-03-16 13:08 ` [PATCH v2 13/23] mm/vma: introduce vma_test[_any[_mask]](), and make inlining consistent Lorenzo Stoakes (Oracle)
2026-03-16 13:08 ` [PATCH v2 14/23] tools/testing/vma: update VMA flag tests to test vma_test[_any_mask]() Lorenzo Stoakes (Oracle)
2026-03-16 13:08 ` [PATCH v2 15/23] mm: introduce vma_flags_count() and vma[_flags]_test_single_mask() Lorenzo Stoakes (Oracle)
2026-03-16 13:08 ` [PATCH v2 16/23] tools/testing/vma: test vma_flags_count,vma[_flags]_test_single_mask Lorenzo Stoakes (Oracle)
2026-03-16 13:08 ` [PATCH v2 17/23] mm: convert do_brk_flags() to use vma_flags_t Lorenzo Stoakes (Oracle)
2026-03-16 23:23 ` Paul Moore
2026-03-16 13:08 ` Lorenzo Stoakes (Oracle) [this message]
2026-03-16 13:08 ` [PATCH v2 19/23] mm/vma: introduce vma_clear_flags[_mask]() Lorenzo Stoakes (Oracle)
2026-03-16 13:08 ` [PATCH v2 20/23] tools/testing/vma: update VMA tests to test vma_clear_flags[_mask]() Lorenzo Stoakes (Oracle)
2026-03-16 13:08 ` [PATCH v2 21/23] mm/vma: convert as much as we can in mm/vma.c to vma_flags_t Lorenzo Stoakes (Oracle)
2026-03-16 13:08 ` [PATCH v2 22/23] mm/vma: convert vma_modify_flags[_uffd]() to use vma_flags_t Lorenzo Stoakes (Oracle)
2026-03-16 13:08 ` [PATCH v2 23/23] mm/vma: convert __mmap_region() " Lorenzo Stoakes (Oracle)
2026-03-16 16:17 ` [PATCH v2 00/23] mm/vma: convert vm_flags_t to vma_flags_t in vma code Andrew Morton
2026-03-16 16:21 ` Andrew Morton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2f82b5b93599e89b391ee4672928cefdfd2fb2f8.1773665966.git.ljs@kernel.org \
--to=ljs@kernel$(echo .)org \
--cc=Liam.Howlett@oracle$(echo .)com \
--cc=agordeev@linux$(echo .)ibm.com \
--cc=akpm@linux-foundation$(echo .)org \
--cc=alex@ghiti$(echo .)fr \
--cc=anton.ivanov@cambridgegreys$(echo .)com \
--cc=aou@eecs$(echo .)berkeley.edu \
--cc=bcain@kernel$(echo .)org \
--cc=borntraeger@linux$(echo .)ibm.com \
--cc=bp@alien8$(echo .)de \
--cc=brauner@kernel$(echo .)org \
--cc=catalin.marinas@arm$(echo .)com \
--cc=chengming.zhou@linux$(echo .)dev \
--cc=chenhuacai@kernel$(echo .)org \
--cc=chleroy@kernel$(echo .)org \
--cc=dave.hansen@linux$(echo .)intel.com \
--cc=david@kernel$(echo .)org \
--cc=dinguyen@kernel$(echo .)org \
--cc=gor@linux$(echo .)ibm.com \
--cc=hca@linux$(echo .)ibm.com \
--cc=hpa@zytor$(echo .)com \
--cc=jack@suse$(echo .)cz \
--cc=jannh@google$(echo .)com \
--cc=johannes@sipsolutions$(echo .)net \
--cc=kees@kernel$(echo .)org \
--cc=kernel@xen0n$(echo .)name \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-fsdevel@vger$(echo .)kernel.org \
--cc=linux-hexagon@vger$(echo .)kernel.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-mips@vger$(echo .)kernel.org \
--cc=linux-mm@kvack$(echo .)org \
--cc=linux-riscv@lists$(echo .)infradead.org \
--cc=linux-s390@vger$(echo .)kernel.org \
--cc=linux-snps-arc@lists$(echo .)infradead.org \
--cc=linux-um@lists$(echo .)infradead.org \
--cc=linux@armlinux$(echo .)org.uk \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
--cc=loongarch@lists$(echo .)linux.dev \
--cc=maddy@linux$(echo .)ibm.com \
--cc=mhocko@suse$(echo .)com \
--cc=mingo@redhat$(echo .)com \
--cc=mpe@ellerman$(echo .)id.au \
--cc=npiggin@gmail$(echo .)com \
--cc=omosnace@redhat$(echo .)com \
--cc=palmer@dabbelt$(echo .)com \
--cc=paul@paul-moore$(echo .)com \
--cc=pfalcato@suse$(echo .)de \
--cc=pjw@kernel$(echo .)org \
--cc=richard@nod$(echo .)at \
--cc=rppt@kernel$(echo .)org \
--cc=selinux@vger$(echo .)kernel.org \
--cc=stephen.smalley.work@gmail$(echo .)com \
--cc=surenb@google$(echo .)com \
--cc=svens@linux$(echo .)ibm.com \
--cc=tglx@kernel$(echo .)org \
--cc=tsbogend@alpha$(echo .)franken.de \
--cc=vbabka@kernel$(echo .)org \
--cc=vgupta@kernel$(echo .)org \
--cc=viro@zeniv$(echo .)linux.org.uk \
--cc=will@kernel$(echo .)org \
--cc=x86@kernel$(echo .)org \
--cc=xu.xin16@zte$(echo .)com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox