Re: [PATCH v2 01/23] mm/vma: add vma_flags_empty(), vma_flags_and(), vma_flags_diff_pair()
"Vlastimil Babka (SUSE)" <[email protected]> Wed, 18 Mar 2026 15:40:45 +0100
| Newsgroups | org.kernel.vger.linux-hexagon,dev.linux.lists.loongarch,org.infradead.lists.linux-riscv,org.infradead.lists.linux-snps-arc,org.infradead.lists.linux-um,org.kernel.vger.linux-fsdevel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-mips,org.kernel.vger.linux-s390,org.kernel.vger.selinux,org.kvack.linux-mm,org.ozlabs.lists.linuxppc-dev |
|---|---|
| Message-ID | <[email protected]> |
On 3/16/26 14:07, Lorenzo Stoakes (Oracle) wrote: > Firstly, add the ability to determine if VMA flags are empty, that is no > flags are set in a vma_flags_t value. > > Next, add the ability to obtain the equivalent of the bitwise and of two > vma_flags_t values, via vma_flags_and(). Nit: "two values" is vma_flags_and_mask(), while vma_flags_and() takes one value and list of flags, no? > Next, add the ability to obtain the difference between two sets of VMA > flags, that is the equivalent to the exclusive bitwise OR of the two sets > of flags, via vma_flags_diff_pair(). > > vma_flags_xxx_mask() typically operates on a pointer to a vma_flags_t > value, which is assumed to be an lvalue of some kind (such as a field in a > struct or a stack variable) and an rvalue of some kind (typically a > constant set of VMA flags obtained e.g. via mk_vma_flags() or equivalent). > > However vma_flags_diff_pair() is intended to operate on two lvalues, so use > the _pair() suffix to make this clear. > > Finally, update VMA userland tests to add these helpers. > > We also port bitmap_xor() and __bitmap_xor() to the tools/ headers and > source to allow the tests to work with vma_flags_diff_pair(). > > Signed-off-by: Lorenzo Stoakes (Oracle) <[email protected]> Acked-by: Vlastimil Babka (SUSE) <[email protected]>