Message ID | 1582692658-3294-2-git-send-email-anshuman.khandual@arm.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | mm/vma: some more minor changes | expand |
On 2/26/20 5:50 AM, Anshuman Khandual wrote: > Move VM_NO_KHUGEPAGED into generic header (include/linux/mm.h). This just > makes sure that no VMA flag is scattered in individual function files any > longer. While at this, fix an old comment which is no longer valid. > > Cc: Andrew Morton <akpm@linux-foundation.org> > Cc: linux-mm@kvack.org > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com> > --- > include/linux/mm.h | 3 ++- > mm/khugepaged.c | 2 -- > 2 files changed, 2 insertions(+), 3 deletions(-) > > diff --git a/include/linux/mm.h b/include/linux/mm.h > index 52269e56c514..6f7e400e6ea3 100644 > --- a/include/linux/mm.h > +++ b/include/linux/mm.h > @@ -287,6 +287,8 @@ extern unsigned int kobjsize(const void *objp); > #define VM_NOHUGEPAGE 0x40000000 /* MADV_NOHUGEPAGE marked this vma */ > #define VM_MERGEABLE 0x80000000 /* KSM may merge identical pages */ > > +#define VM_NO_KHUGEPAGED (VM_SPECIAL | VM_HUGETLB) While the preprocessor doesn't mind that VM_SPECIAL is only defined later, I would have moved this below VM_SPECIAL definition anyway, where it fits better, and add a comment like other defines there do?
On 02/26/2020 05:04 PM, Vlastimil Babka wrote: > On 2/26/20 5:50 AM, Anshuman Khandual wrote: >> Move VM_NO_KHUGEPAGED into generic header (include/linux/mm.h). This just >> makes sure that no VMA flag is scattered in individual function files any >> longer. While at this, fix an old comment which is no longer valid. >> >> Cc: Andrew Morton <akpm@linux-foundation.org> >> Cc: linux-mm@kvack.org >> Cc: linux-kernel@vger.kernel.org >> Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com> >> --- >> include/linux/mm.h | 3 ++- >> mm/khugepaged.c | 2 -- >> 2 files changed, 2 insertions(+), 3 deletions(-) >> >> diff --git a/include/linux/mm.h b/include/linux/mm.h >> index 52269e56c514..6f7e400e6ea3 100644 >> --- a/include/linux/mm.h >> +++ b/include/linux/mm.h >> @@ -287,6 +287,8 @@ extern unsigned int kobjsize(const void *objp); >> #define VM_NOHUGEPAGE 0x40000000 /* MADV_NOHUGEPAGE marked this vma */ >> #define VM_MERGEABLE 0x80000000 /* KSM may merge identical pages */ >> >> +#define VM_NO_KHUGEPAGED (VM_SPECIAL | VM_HUGETLB) > > While the preprocessor doesn't mind that VM_SPECIAL is only defined later, I > would have moved this below VM_SPECIAL definition anyway, where it fits better, > and add a comment like other defines there do? Sure, will do.
diff --git a/include/linux/mm.h b/include/linux/mm.h index 52269e56c514..6f7e400e6ea3 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -287,6 +287,8 @@ extern unsigned int kobjsize(const void *objp); #define VM_NOHUGEPAGE 0x40000000 /* MADV_NOHUGEPAGE marked this vma */ #define VM_MERGEABLE 0x80000000 /* KSM may merge identical pages */ +#define VM_NO_KHUGEPAGED (VM_SPECIAL | VM_HUGETLB) + #ifdef CONFIG_ARCH_USES_HIGH_VMA_FLAGS #define VM_HIGH_ARCH_BIT_0 32 /* bit only usable on 64-bit architectures */ #define VM_HIGH_ARCH_BIT_1 33 /* bit only usable on 64-bit architectures */ @@ -356,7 +358,6 @@ extern unsigned int kobjsize(const void *objp); /* * Special vmas that are non-mergable, non-mlock()able. - * Note: mm/huge_memory.c VM_NO_THP depends on this definition. */ #define VM_SPECIAL (VM_IO | VM_DONTEXPAND | VM_PFNMAP | VM_MIXEDMAP) diff --git a/mm/khugepaged.c b/mm/khugepaged.c index b679908743cb..494443628850 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -308,8 +308,6 @@ struct attribute_group khugepaged_attr_group = { }; #endif /* CONFIG_SYSFS */ -#define VM_NO_KHUGEPAGED (VM_SPECIAL | VM_HUGETLB) - int hugepage_madvise(struct vm_area_struct *vma, unsigned long *vm_flags, int advice) {
Move VM_NO_KHUGEPAGED into generic header (include/linux/mm.h). This just makes sure that no VMA flag is scattered in individual function files any longer. While at this, fix an old comment which is no longer valid. Cc: Andrew Morton <akpm@linux-foundation.org> Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com> --- include/linux/mm.h | 3 ++- mm/khugepaged.c | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-)