From 9e2c184da18f8d7093c5d006aa465a47c2041a28 Mon Sep 17 00:00:00 2001 From: Carlos Llamas Date: Tue, 28 May 2024 16:34:19 +0000 Subject: [PATCH] Revert "ANDROID: vendor_hooks: Add hook for binder_detect_low_async_space_locked" This reverts commit 7ce117301e1bd43ff24e0f83d1bf27ec1b77f17e. The alloc->mutex to spinlock_t patches from [1] are being backported into this branch. The vendor hooks will be reapplied on top of these backports in a way that matches the new structure of the code. Link: https://lore.kernel.org/all/20231201172212.1813387-1-cmllamas@google.com/ [1] Change-Id: I7f4aaab31b4462a40881c596abdcbef835a32e4a Signed-off-by: Carlos Llamas --- drivers/android/binder_alloc.c | 8 -------- drivers/android/vendor_hooks.c | 1 - include/trace/hooks/binder.h | 4 ---- 3 files changed, 13 deletions(-) diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c index 4325384965e7..aaa07ff5e6d6 100644 --- a/drivers/android/binder_alloc.c +++ b/drivers/android/binder_alloc.c @@ -382,7 +382,6 @@ static struct binder_buffer *binder_alloc_new_buf_locked( void __user *end_page_addr; size_t size, data_offsets_size; int ret; - bool should_fail = false; /* Check binder_alloc is fully initialized */ if (!binder_alloc_get_vma(alloc)) { @@ -410,13 +409,6 @@ static struct binder_buffer *binder_alloc_new_buf_locked( } trace_android_vh_binder_alloc_new_buf_locked(size, &alloc->free_async_space, is_async); - trace_android_vh_binder_detect_low_async_space_locked(is_async, &alloc->free_async_space, pid, &should_fail); - if (should_fail) { - binder_alloc_debug(BINDER_DEBUG_BUFFER_ALLOC, - "%d: binder_alloc_buf size %zd failed, not allowed to alloc more async space\n", - alloc->pid, size); - return ERR_PTR(-EPERM); - } /* Pad 0-size buffers so they get assigned unique addresses */ size = max(size, sizeof(void *)); diff --git a/drivers/android/vendor_hooks.c b/drivers/android/vendor_hooks.c index c4b14f965ad3..31dde279e279 100644 --- a/drivers/android/vendor_hooks.c +++ b/drivers/android/vendor_hooks.c @@ -391,7 +391,6 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_ioctl_end); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_looper_exited); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_spawn_new_thread); EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_has_special_work_ilocked); -EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_detect_low_async_space_locked); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_delayacct_init); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_delayacct_tsk_init); EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_delayacct_tsk_free); diff --git a/include/trace/hooks/binder.h b/include/trace/hooks/binder.h index e67cfc5fee1b..77bfa4db10e2 100644 --- a/include/trace/hooks/binder.h +++ b/include/trace/hooks/binder.h @@ -82,10 +82,6 @@ DECLARE_HOOK(android_vh_binder_select_special_worklist, DECLARE_HOOK(android_vh_binder_alloc_new_buf_locked, TP_PROTO(size_t size, size_t *free_async_space, int is_async), TP_ARGS(size, free_async_space, is_async)); - -DECLARE_HOOK(android_vh_binder_detect_low_async_space_locked, - TP_PROTO(int is_async, size_t *free_async_space, int pid, bool *should_fail), - TP_ARGS(is_async, free_async_space, pid, should_fail)); struct binder_transaction_data; DECLARE_HOOK(android_vh_binder_reply, TP_PROTO(struct binder_proc *target_proc, struct binder_proc *proc,