Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm: rename vma_flag_test/set_atomic() to vma_test/set_atomic_flag()

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.

Link: https://lkml.kernel.org/r/033dcf12e819dee5064582bced9b12ea346d1607.1769097829.git.lorenzo.stoakes@oracle.com
Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Reviewed-by: Pedro Falcato <pfalcato@suse.de>
Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Barry Song <baohua@kernel.org>
Cc: David Hildenbrand <david@kernel.org>
Cc: Dev Jain <dev.jain@arm.com>
Cc: Jason Gunthorpe <jgg@nvidia.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Zi Yan <ziy@nvidia.com>
Cc: Damien Le Moal <dlemoal@kernel.org>
Cc: "Darrick J. Wong" <djwong@kernel.org>
Cc: Jarkko Sakkinen <jarkko@kernel.org>
Cc: Yury Norov <ynorov@nvidia.com>
Cc: Chris Mason <clm@fb.com>
Cc: Pedro Falcato <pfalcato@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Lorenzo Stoakes and committed by
Andrew Morton
e388d312 a30de4c6

+7 -10
+5 -8
include/linux/mm.h
··· 987 987 __vm_flags_mod(vma, set, clear); 988 988 } 989 989 990 - static inline bool __vma_flag_atomic_valid(struct vm_area_struct *vma, 991 - vma_flag_t bit) 990 + static inline bool __vma_atomic_valid_flag(struct vm_area_struct *vma, vma_flag_t bit) 992 991 { 993 992 const vm_flags_t mask = BIT((__force int)bit); 994 993 ··· 1002 1003 * Set VMA flag atomically. Requires only VMA/mmap read lock. Only specific 1003 1004 * valid flags are allowed to do this. 1004 1005 */ 1005 - static inline void vma_flag_set_atomic(struct vm_area_struct *vma, 1006 - vma_flag_t bit) 1006 + static inline void vma_set_atomic_flag(struct vm_area_struct *vma, vma_flag_t bit) 1007 1007 { 1008 1008 unsigned long *bitmap = vma->flags.__vma_flags; 1009 1009 1010 1010 vma_assert_stabilised(vma); 1011 - if (__vma_flag_atomic_valid(vma, bit)) 1011 + if (__vma_atomic_valid_flag(vma, bit)) 1012 1012 set_bit((__force int)bit, bitmap); 1013 1013 } 1014 1014 ··· 1018 1020 * This is necessarily racey, so callers must ensure that serialisation is 1019 1021 * achieved through some other means, or that races are permissible. 1020 1022 */ 1021 - static inline bool vma_flag_test_atomic(struct vm_area_struct *vma, 1022 - vma_flag_t bit) 1023 + static inline bool vma_test_atomic_flag(struct vm_area_struct *vma, vma_flag_t bit) 1023 1024 { 1024 - if (__vma_flag_atomic_valid(vma, bit)) 1025 + if (__vma_atomic_valid_flag(vma, bit)) 1025 1026 return test_bit((__force int)bit, &vma->vm_flags); 1026 1027 1027 1028 return false;
+1 -1
mm/khugepaged.c
··· 1741 1741 * obtained on guard region installation after the flag is set, so this 1742 1742 * check being performed under this lock excludes races. 1743 1743 */ 1744 - if (vma_flag_test_atomic(vma, VMA_MAYBE_GUARD_BIT)) 1744 + if (vma_test_atomic_flag(vma, VMA_MAYBE_GUARD_BIT)) 1745 1745 return false; 1746 1746 1747 1747 return true;
+1 -1
mm/madvise.c
··· 1140 1140 * acquire an mmap/VMA write lock to read it. All remaining readers may 1141 1141 * or may not see the flag set, but we don't care. 1142 1142 */ 1143 - vma_flag_set_atomic(vma, VMA_MAYBE_GUARD_BIT); 1143 + vma_set_atomic_flag(vma, VMA_MAYBE_GUARD_BIT); 1144 1144 1145 1145 /* 1146 1146 * If anonymous and we are establishing page tables the VMA ought to