ANDROID: vendor_hook: Add hooks in unuse_pte_range() and try_to_unuse()

When the page is unused, a vendor hook android_vh_unuse_swap_page
should be called to specify that the page should not be swapped
to the specified swap location any more.

Bug: 234214858
Signed-off-by: Bing Han <bing.han@transsion.com>
Change-Id: I3fc3675020517f7cc69c76a06150dfb2380dae21
This commit is contained in:
Bing Han
2022-06-10 18:53:44 +08:00
committed by Treehugger Robot
parent 7222a0b29b
commit bc4c73c182
3 changed files with 6 additions and 0 deletions

View File

@@ -2014,6 +2014,7 @@ static int unuse_pte_range(struct vm_area_struct *vma, pmd_t *pmd,
}
try_to_free_swap(page);
trace_android_vh_unuse_swap_page(si, page);
unlock_page(page);
put_page(page);
@@ -2252,6 +2253,7 @@ retry:
lock_page(page);
wait_on_page_writeback(page);
try_to_free_swap(page);
trace_android_vh_unuse_swap_page(si, page);
unlock_page(page);
put_page(page);