ANDROID: vendor_hook: Add hook in migrate_page_states()

Provide a vendor hook to copy the status whether the page need to be
reclaimed to a specified swap location.

Bug: 234214858
Signed-off-by: Bing Han <bing.han@transsion.com>
Change-Id: I1a451b40407718900b56de6ed17b7fd5ef56da01
This commit is contained in:
Bing Han
2022-06-10 13:38:38 +08:00
committed by Treehugger Robot
parent 89a247a638
commit 5bc9b10c45
3 changed files with 6 additions and 0 deletions

View File

@@ -411,6 +411,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_handle_pte_fault_end);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cow_user_page);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_swapin_add_anon_rmap);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_waiting_for_page_migration);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_migrate_page_states);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_page_isolated_for_reclaim);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_inactive_is_low);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_snapshot_refaults);

View File

@@ -161,6 +161,9 @@ DECLARE_HOOK(android_vh_swapin_add_anon_rmap,
DECLARE_HOOK(android_vh_waiting_for_page_migration,
TP_PROTO(struct page *page),
TP_ARGS(page));
DECLARE_HOOK(android_vh_migrate_page_states,
TP_PROTO(struct page *page, struct page *newpage),
TP_ARGS(page, newpage));
DECLARE_HOOK(android_vh_page_isolated_for_reclaim,
TP_PROTO(struct mm_struct *mm, struct page *page),
TP_ARGS(mm, page));

View File

@@ -587,6 +587,8 @@ void migrate_page_states(struct page *newpage, struct page *page)
{
int cpupid;
trace_android_vh_migrate_page_states(page, newpage);
if (PageError(page))
SetPageError(newpage);
if (PageReferenced(page))