From d0590b99c9946526ee434a33c47d69056d137e06 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 16 Aug 2022 14:37:37 +0200 Subject: [PATCH] Revert "ANDROID: vendor_hooks: Add hooks to extend the struct swap_info_struct" This reverts commit 667f0d71dc08e25bf013cafa617adf6789fe5b93. The hooks android_vh_init_swap_info_struct and android_vh_alloc_si are 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: If01c284ebf15e804e7cf34e854b7db0d5b68ae1b --- drivers/android/vendor_hooks.c | 2 -- include/trace/hooks/mm.h | 6 ------ mm/swapfile.c | 8 ++------ 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index 91f67a58a0bc..6238312d55e9 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -443,9 +443,7 @@ 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_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_set_shmem_page_flag); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_pidfd_open); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sched_pelt_multiplier); diff --git a/include/trace/hooks/mm.h b/include/trace/hooks/mm.h index 0362142a1323..213b14ea4cc6 100644 --- a/include/trace/hooks/mm.h +++ b/include/trace/hooks/mm.h @@ -245,15 +245,9 @@ 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_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)); 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 677f235806c2..0aba6e4742d1 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -2902,15 +2902,12 @@ late_initcall(max_swapfiles_check); static struct swap_info_struct *alloc_swap_info(void) { - struct swap_info_struct *p = NULL; + struct swap_info_struct *p; struct swap_info_struct *defer = NULL; unsigned int type; int i; - bool skip = false; - trace_android_vh_alloc_si(&p, &skip); - if (!skip) - p = kvzalloc(struct_size(p, avail_lists, nr_node_ids), GFP_KERNEL); + p = kvzalloc(struct_size(p, avail_lists, nr_node_ids), GFP_KERNEL); if (!p) return ERR_PTR(-ENOMEM); @@ -3393,7 +3390,6 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags) (swap_flags & SWAP_FLAG_PRIO_MASK) >> SWAP_FLAG_PRIO_SHIFT; enable_swap_info(p, prio, swap_map, cluster_info, frontswap_map); - trace_android_vh_init_swap_info_struct(p, swap_avail_heads); pr_info("Adding %uk swap on %s. Priority:%d extents:%d across:%lluk %s%s%s%s%s\n", p->pages<<(PAGE_SHIFT-10), name->name, p->prio, nr_extents, (unsigned long long)span<<(PAGE_SHIFT-10),