ANDROID: vendor_hook: Add hook in __free_pages()

This reverts commit eb99e6d80e

The hook android_vh_free_pages is deleted, due to the symbol is
not added to the abi list. The symbol is added to the abi list in
patch:2183484. This patch is to add the hook android_vh_free_pages
again.

Bug: 234214858
Bug: 203756332
Cc: Greg Kroah-Hartman <gregkh@google.com>
Signed-off-by: Bing Han <bing.han@transsion.com>
Change-Id: I2c97ea4d310e2004b94d891678127c17f7b07c93
This commit is contained in:
Bing Han
2022-08-18 15:38:58 +08:00
committed by Todd Kjos
parent 6c56a05b87
commit a47fb6a9ae
3 changed files with 5 additions and 0 deletions

View File

@@ -446,5 +446,6 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_unuse_swap_page);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_init_swap_info_struct);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_si_swapinfo);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alloc_si);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_free_pages);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_shmem_page_flag);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sched_pelt_multiplier);

View File

@@ -254,6 +254,9 @@ DECLARE_HOOK(android_vh_si_swapinfo,
DECLARE_HOOK(android_vh_alloc_si,
TP_PROTO(struct swap_info_struct **p, bool *skip),
TP_ARGS(p, skip));
DECLARE_HOOK(android_vh_free_pages,
TP_PROTO(struct page *page, unsigned int order),
TP_ARGS(page, order));
DECLARE_HOOK(android_vh_set_shmem_page_flag,
TP_PROTO(struct page *page),
TP_ARGS(page));

View File

@@ -5183,6 +5183,7 @@ static inline void free_the_page(struct page *page, unsigned int order)
void __free_pages(struct page *page, unsigned int order)
{
trace_android_vh_free_pages(page, order);
if (put_page_testzero(page))
free_the_page(page, order);
else if (!PageHead(page))