summaryrefslogtreecommitdiff
path: root/mm/page_ext.c
diff options
context:
space:
mode:
authorReed Riley <reed@riley.engineer>2024-04-15 21:08:13 -0700
committerReed Riley <reed@riley.engineer>2024-04-15 21:08:13 -0700
commite5e8f203d77f90d1af8ebfd794eb1593582b85cc (patch)
tree4b247a45e411ea62d5af495eec775d3d48c40676 /mm/page_ext.c
parent6432d7745c1d0eba610fed85a8a6bac1864e858d (diff)
parent72cfb036b00a2c9f59a5d6ff1bc2d039ffb67490 (diff)
Merge branch 'memalloc_prof_v6' of https://github.com/surenbaghdasaryan/linux
Diffstat (limited to 'mm/page_ext.c')
-rw-r--r--mm/page_ext.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/mm/page_ext.c b/mm/page_ext.c
index 4548fcc66d74..e7d8f1a5589e 100644
--- a/mm/page_ext.c
+++ b/mm/page_ext.c
@@ -10,6 +10,7 @@
#include <linux/page_idle.h>
#include <linux/page_table_check.h>
#include <linux/rcupdate.h>
+#include <linux/pgalloc_tag.h>
/*
* struct page extension
@@ -82,6 +83,9 @@ static struct page_ext_operations *page_ext_ops[] __initdata = {
#if defined(CONFIG_PAGE_IDLE_FLAG) && !defined(CONFIG_64BIT)
&page_idle_ops,
#endif
+#ifdef CONFIG_MEM_ALLOC_PROFILING
+ &page_alloc_tagging_ops,
+#endif
#ifdef CONFIG_PAGE_TABLE_CHECK
&page_table_check_ops,
#endif
@@ -91,7 +95,16 @@ unsigned long page_ext_size;
static unsigned long total_usage;
+#ifdef CONFIG_MEM_ALLOC_PROFILING_DEBUG
+/*
+ * To ensure correct allocation tagging for pages, page_ext should be available
+ * before the first page allocation. Otherwise early task stacks will be
+ * allocated before page_ext initialization and missing tags will be flagged.
+ */
+bool early_page_ext __meminitdata = true;
+#else
bool early_page_ext __meminitdata;
+#endif
static int __init setup_early_page_ext(char *str)
{
early_page_ext = true;