[RFC PATCH 6/6] WORKAROUND: Don't split large folios on madvise

Ryan Roberts ryan.roberts at arm.com
Fri Mar 17 03:58:02 PDT 2023


Signed-off-by: Ryan Roberts <ryan.roberts at arm.com>
---
 mm/madvise.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/mm/madvise.c b/mm/madvise.c
index 340125d08c03..8fb84da744e1 100644
--- a/mm/madvise.c
+++ b/mm/madvise.c
@@ -447,6 +447,7 @@ static int madvise_cold_or_pageout_pte_range(pmd_t *pmd,
 		 * are sure it's worth. Split it if we are only owner.
 		 */
 		if (folio_test_large(folio)) {
+#if 0
 			if (folio_mapcount(folio) != 1)
 				break;
 			if (pageout_anon_only_filter && !folio_test_anon(folio))
@@ -469,6 +470,9 @@ static int madvise_cold_or_pageout_pte_range(pmd_t *pmd,
 			pte--;
 			addr -= PAGE_SIZE;
 			continue;
+#else
+			break;
+#endif
 		}

 		/*
@@ -664,6 +668,7 @@ static int madvise_free_pte_range(pmd_t *pmd, unsigned long addr,
 		 * deactivate all pages.
 		 */
 		if (folio_test_large(folio)) {
+#if 0
 			if (folio_mapcount(folio) != 1)
 				goto out;
 			folio_get(folio);
@@ -684,6 +689,9 @@ static int madvise_free_pte_range(pmd_t *pmd, unsigned long addr,
 			pte--;
 			addr -= PAGE_SIZE;
 			continue;
+#else
+			goto out;
+#endif
 		}

 		if (folio_test_swapcache(folio) || folio_test_dirty(folio)) {
--
2.25.1




More information about the linux-arm-kernel mailing list