ANDROID: vendor_hooks: Add hooks for page_cache_sync_ra

Add hooks to modify the policy of page_cache_sync_ra for oem's optimization
of synchronous readahead.

Bug: 243477375

Signed-off-by: Aran Dalton <arda@allwinnertech.com>
Change-Id: Ic3397d26e58d2d1189d9db25914c2f3d95c69226
This commit is contained in:
Aran Dalton
2022-08-23 14:53:07 +08:00
committed by Suren Baghdasaryan
parent 5a3e902fed
commit 5dc0125847
3 changed files with 6 additions and 0 deletions

View File

@@ -450,3 +450,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mmc_ffu_update_cid);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_uid);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_free_user);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_modify_thermal_cpu_get_power);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_page_cache_forced_ra);

View File

@@ -118,6 +118,9 @@ DECLARE_HOOK(android_vh_page_should_be_protected,
DECLARE_HOOK(android_vh_mark_page_accessed,
TP_PROTO(struct page *page),
TP_ARGS(page));
DECLARE_HOOK(android_vh_page_cache_forced_ra,
TP_PROTO(struct readahead_control *ractl, unsigned long req_count, bool *do_forced_ra),
TP_ARGS(ractl, req_count, do_forced_ra));
#endif /* _TRACE_HOOK_MM_H */

View File

@@ -580,6 +580,8 @@ void page_cache_sync_ra(struct readahead_control *ractl,
do_forced_ra = true;
}
trace_android_vh_page_cache_forced_ra(ractl, req_count, &do_forced_ra);
/* be dumb */
if (do_forced_ra) {
force_page_cache_ra(ractl, req_count);