ANDROID: vendor_hook: Add hook in si_swapinfo()

Provide a vendor hook android_vh_si_swapinf to replace the
process of updating nr_to_be_unused. When the page is swapped
to a specified swap location, nr_to_be_unused should not be
updated. Because the specified swap is regarded as a reserved
extended memory.

Bug: 234214858
Signed-off-by: Bing Han <bing.han@transsion.com>
Change-Id: Ie41caec345658589bf908fb0f96d038d1fba21f3
This commit is contained in:
Bing Han
2022-06-10 19:06:18 +08:00
committed by Treehugger Robot
parent 667f0d71dc
commit ed2b11d639
3 changed files with 7 additions and 1 deletions

View File

@@ -191,6 +191,9 @@ DECLARE_HOOK(android_vh_unuse_swap_page,
DECLARE_HOOK(android_vh_init_swap_info_struct,
TP_PROTO(struct swap_info_struct *p, struct plist_head *swap_avail_heads),
TP_ARGS(p, swap_avail_heads));
DECLARE_HOOK(android_vh_si_swapinfo,
TP_PROTO(struct swap_info_struct *si, bool *skip),
TP_ARGS(si, skip));
DECLARE_HOOK(android_vh_alloc_si,
TP_PROTO(struct swap_info_struct **p, bool *skip),
TP_ARGS(p, skip));