ANDROID: vendor_hook: add vendor hook on calculate_totalreserve_pages

This vendor hook enables or disables updating the LMKD zone watermark level.

Bug: 396115949
Test: build
Change-Id: I0089a0586821120e47c46e08bcfea11a1602d516
Signed-off-by: Martin Liu <liumartin@google.com>
This commit is contained in:
Martin Liu
2025-04-25 15:33:50 +00:00
parent b01e71951e
commit 6ab12e6b69
3 changed files with 8 additions and 0 deletions
+1
View File
@@ -512,3 +512,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_compaction_try_to_compact_exit);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_direct_reclaim_enter);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_direct_reclaim_exit);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mm_may_oom_exit);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_calculate_totalreserve_pages);
+3
View File
@@ -444,6 +444,9 @@ struct oom_control;
DECLARE_HOOK(android_vh_mm_may_oom_exit,
TP_PROTO(struct oom_control *oc, unsigned long did_some_progress),
TP_ARGS(oc, did_some_progress));
DECLARE_HOOK(android_vh_calculate_totalreserve_pages,
TP_PROTO(bool *skip),
TP_ARGS(skip));
#endif /* _TRACE_HOOK_MM_H */
/* This part must be outside protection */
+4
View File
@@ -6330,6 +6330,7 @@ static void calculate_totalreserve_pages(void)
struct pglist_data *pgdat;
unsigned long reserve_pages = 0;
enum zone_type i, j;
bool skip = false;
for_each_online_pgdat(pgdat) {
@@ -6358,6 +6359,9 @@ static void calculate_totalreserve_pages(void)
}
}
totalreserve_pages = reserve_pages;
trace_android_vh_calculate_totalreserve_pages(&skip);
if (skip)
return;
trace_mm_calculate_totalreserve_pages(totalreserve_pages);
}