ANDROID: mm: add vendor hook to bypass gcma cleancache put page

Cleancache put page operation is slower than just dropping file pages.
So, I'd like to restrict gcma store page on some conditions.
For example, direct reclaim contexts can bypass cleancache operation
for better reclaim performance.

Bug: 410432482

Change-Id: Ifc38b9b2912d1832dac5d2003ebd042683f78a1f
Signed-off-by: Sooyong Suk <s.suk@samsung.corp-partner.google.com>
This commit is contained in:
Sooyong Suk
2025-07-09 09:37:22 +09:00
committed by Treehugger Robot
parent 354fa5d5bf
commit 3503e439a9
3 changed files with 9 additions and 0 deletions
+1
View File
@@ -578,6 +578,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_shrink_node);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_cpuset_fork);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_uid);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_free_user);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_gcma_cc_store_page_bypass);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_gzvm_vcpu_exit_reason);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_gzvm_handle_demand_page_pre);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_gzvm_handle_demand_page_post);
+3
View File
@@ -537,6 +537,9 @@ DECLARE_HOOK(android_vh_filemap_add_folio,
TP_PROTO(struct address_space *mapping, struct folio *folio,
pgoff_t index),
TP_ARGS(mapping, folio, index));
DECLARE_HOOK(android_vh_gcma_cc_store_page_bypass,
TP_PROTO(bool *bypass),
TP_ARGS(bypass));
#endif /* _TRACE_HOOK_MM_H */
/* This part must be outside protection */
+5
View File
@@ -13,6 +13,7 @@
#include <linux/idr.h>
#include <linux/slab.h>
#include <linux/xarray.h>
#include <trace/hooks/mm.h>
#include "gcma_sysfs.h"
/*
@@ -747,7 +748,11 @@ static void gcma_cc_store_page(int hash_id, struct cleancache_filekey key,
void *src, *dst;
bool is_new = false;
bool workingset = PageWorkingset(page);
bool bypass = false;
trace_android_vh_gcma_cc_store_page_bypass(&bypass);
if (bypass)
return;
/*
* This cleancache function is called under irq disabled so every
* locks in this function should take of the irq if they are