[PATCH 38/45] mm/madvise: Make swapin_test_walk skip hugetlb vmas

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Skip hugetlb vmas as we are not interested in those.

Signed-off-by: Oscar Salvador <osalvador@xxxxxxx>
---
 mm/madvise.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/mm/madvise.c b/mm/madvise.c
index 96c026fe0c99..4c7c409e8b4a 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -212,8 +212,20 @@ static int swapin_walk_pmd_entry(pmd_t *pmd, unsigned long start,
 	return 0;
 }
 
+static int swapin_test_walk(unsigned long start, unsigned long end,
+			    struct mm_walk *walk)
+{
+	struct vm_area_struct *vma = walk->vma;
+
+	if (is_vm_hugetlb_page(vma))
+		return 1;
+
+	return 0;
+}
+
 static const struct mm_walk_ops swapin_walk_ops = {
 	.pmd_entry		= swapin_walk_pmd_entry,
+	.test_walk		= swapin_test_walk,
 	.walk_lock		= PGWALK_RDLOCK,
 };
 
-- 
2.26.2





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux