mm: add pagetrace support [1/2]
PD#SWPL-70022
Problem:
No pagetrace function on 5.15 kernel
Solution:
porting it from 5.4
Verify:
local
Signed-off-by: Tao Zeng <tao.zeng@amlogic.com>
Change-Id: I69cc8b4f4fa4c323204f86e5c76613cd3d6087df
diff --git a/mm/compaction.c b/mm/compaction.c
index cccb467..2d05f1a 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -24,6 +24,9 @@
#include <linux/page_owner.h>
#include <linux/psi.h>
#include "internal.h"
+#ifdef CONFIG_AMLOGIC_PAGE_TRACE
+#include <linux/amlogic/page_trace.h>
+#endif
#ifdef CONFIG_COMPACTION
static inline void count_compact_event(enum vm_event_item item)
@@ -1738,6 +1741,9 @@ static struct page *compaction_alloc(struct page *migratepage,
freepage = list_entry(cc->freepages.next, struct page, lru);
list_del(&freepage->lru);
cc->nr_freepages--;
+#ifdef CONFIG_AMLOGIC_PAGE_TRACE
+ replace_page_trace(freepage, migratepage);
+#endif
return freepage;
}