lkml.org 
[lkml]   [2023]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH 2/2] mm: rmap: increase COMPOUND_MAPPED to support 512G HugeTLB pages
From
Some architectures may want to support 512G HugeTLB pages in the future.
Adjust COMPOUND_MAPPED to support this page size.

Signed-off-by: James Houghton <jthoughton@google.com>

diff --git a/mm/internal.h b/mm/internal.h
index 400451a4dd49..994381fd5155 100644
--- a/mm/internal.h
+++ b/mm/internal.h
@@ -53,11 +53,11 @@ struct folio_batch;
void page_writeback_init(void);

/*
- * If a 16GB hugetlb folio were mapped by PTEs of all of its 4kB pages,
- * its nr_pages_mapped would be 0x400000: choose the COMPOUND_MAPPED bit
- * above that range, instead of 2*(PMD_SIZE/PAGE_SIZE).
+ * If a 512G hugetlb folio were mapped by PTEs of all of its 4kB pages,
+ * its nr_pages_mapped would be 2^27 (0x8000000): choose the COMPOUND_MAPPED bit
+ * above that range.
*/
-#define COMPOUND_MAPPED 0x800000
+#define COMPOUND_MAPPED (1 << 28)
#define FOLIO_PAGES_MAPPED (COMPOUND_MAPPED - 1)

/*
--
2.40.0.rc0.216.gc4246ad0f0-goog
\
 
 \ /
  Last update: 2023-03-27 00:46    [W:0.167 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site