diff mbox series

[3/3] arm64: mm: Specify smaller page reporting order

Message ID 20210621051152.305224-4-gshan@redhat.com (mailing list archive)
State New
Headers show
Series mm/page_reporting: Make page reporting work on arm64 with 64KB page size | expand

Commit Message

Gavin Shan June 21, 2021, 5:11 a.m. UTC
The page reporting order is stick to @pageblock_order and its size
is 512MB when 64KB base page size is chosen. It also means the
page reporting won't be started if current freeing page can't come
up with a 512MB free area. It's hard when the system memory becomes
fragmented.

This specifies the page reporting order to 5 when the 64KB base page
size is chosen, corresponding to huge page size with 4KB base page
size, so that page reporting has more chance to work.

Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Gavin Shan <gshan@redhat.com>
---
 arch/arm64/include/asm/page.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)
diff mbox series

Patch

diff --git a/arch/arm64/include/asm/page.h b/arch/arm64/include/asm/page.h
index 012cffc574e8..b8386e7d7d47 100644
--- a/arch/arm64/include/asm/page.h
+++ b/arch/arm64/include/asm/page.h
@@ -18,6 +18,19 @@ 
 struct page;
 struct vm_area_struct;
 
+/*
+ * The page reporting won't be started if the freeing page can't come up
+ * with a huge page, which is 512MB with 64KB base page size. It's hard
+ * to have 512MB free area when the memory becomes fragmented, stop page
+ * reporting from working properly. So we choose smaller page reporting
+ * order, which is same to the huge page size (2MB) with 4KB base page
+ * size. However, more overheads will be introduced because page reporting
+ * will be running more frequently.
+ */
+#if defined(CONFIG_PAGE_REPORTING) && defined(CONFIG_ARM64_64K_PAGES)
+#define PAGE_REPORTING_ORDER 5
+#endif
+
 extern void copy_page(void *to, const void *from);
 extern void clear_page(void *to);