From 86be1a3d9f5a43437b9d1815a6014b4be96e1349 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 16 Aug 2022 18:12:02 +0200 Subject: [PATCH] Revert "ANDROID: vendor_hook: Add hook in si_swapinfo()" This reverts commit ed2b11d639fabae87d33a9f2c10b15e87b0f4281. The hook android_vh_si_swapinfo is not used by any vendor, so remove it to help with merge issues with future LTS releases. If this is needed by any real user, it can easily be reverted to add it back and then the symbol should be added to the abi list at the same time to prevent it from being removed again later. Bug: 203756332 Bug: 234214858 Cc: Bing Han Signed-off-by: Greg Kroah-Hartman Change-Id: Ib474a0911dd97d54d2f086258e9d53ddd3451967 --- drivers/android/vendor_hooks.c | 1 - include/trace/hooks/mm.h | 3 --- mm/swapfile.c | 4 +--- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index 13c10551d922..053ce75a212f 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -443,6 +443,5 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_inactive_is_low); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_snapshot_refaults); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_account_swap_pages); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_unuse_swap_page); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_si_swapinfo); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_shmem_page_flag); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sched_pelt_multiplier); diff --git a/include/trace/hooks/mm.h b/include/trace/hooks/mm.h index 213b14ea4cc6..7c97213cd2de 100644 --- a/include/trace/hooks/mm.h +++ b/include/trace/hooks/mm.h @@ -245,9 +245,6 @@ DECLARE_HOOK(android_vh_account_swap_pages, DECLARE_HOOK(android_vh_unuse_swap_page, TP_PROTO(struct swap_info_struct *si, struct page *page), TP_ARGS(si, page)); -DECLARE_HOOK(android_vh_si_swapinfo, - TP_PROTO(struct swap_info_struct *si, bool *skip), - TP_ARGS(si, skip)); DECLARE_HOOK(android_vh_set_shmem_page_flag, TP_PROTO(struct page *page), TP_ARGS(page)); diff --git a/mm/swapfile.c b/mm/swapfile.c index 0aba6e4742d1..fb712ff403c5 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -3454,10 +3454,8 @@ void si_swapinfo(struct sysinfo *val) spin_lock(&swap_lock); for (type = 0; type < nr_swapfiles; type++) { struct swap_info_struct *si = swap_info[type]; - bool skip = false; - trace_android_vh_si_swapinfo(si, &skip); - if (!skip && (si->flags & SWP_USED) && !(si->flags & SWP_WRITEOK)) + if ((si->flags & SWP_USED) && !(si->flags & SWP_WRITEOK)) nr_to_be_unused += si->inuse_pages; } val->freeswap = atomic_long_read(&nr_swap_pages) + nr_to_be_unused;