android_kernel_msm-6.1_noth.../drivers/android
Carlos Llamas baef4637fc UPSTREAM: binder: document the final page calculation
The code to determine the page range for binder_lru_freelist_del() is
quite obscure. It leverages the buffer_size calculated before doing an
oversized buffer split. This is used to figure out if the last page is
being shared with another active buffer. If so, the page gets trimmed
out of the range as it has been previously removed from the freelist.

This would be equivalent to getting the start page of the next in-use
buffer explicitly. However, the code for this is much larger as we can
see in binder_free_buf_locked() routine. Instead, lets settle on
documenting the tricky step and using better names for now.

I believe an ideal solution would be to count the binder_page->users to
determine when a page should be added or removed from the freelist.
However, this is a much bigger change than what I'm willing to risk at
this time.

Signed-off-by: Carlos Llamas <cmllamas@google.com>
Link: https://lore.kernel.org/r/20231201172212.1813387-24-cmllamas@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Bug: 254650075
(cherry picked from commit 67dcc880780569ec40391cae4d8299adc1e7a44e)
Change-Id: Iec2466605fe7f8aa338c8313f586cdb7519a36e7
Signed-off-by: Carlos Llamas <cmllamas@google.com>
2024-05-29 20:51:37 +00:00
..
android_debug_symbols.c ANDROID: android: Create debug_symbols driver 2023-06-30 10:39:56 +00:00
binder.c UPSTREAM: binder: remove pid param in binder_alloc_new_buf() 2024-05-29 20:51:37 +00:00
binder_alloc.c UPSTREAM: binder: document the final page calculation 2024-05-29 20:51:37 +00:00
binder_alloc.h BACKPORT: UPSTREAM: binder: rename lru shrinker utilities 2024-05-29 20:51:37 +00:00
binder_alloc_selftest.c BACKPORT: UPSTREAM: binder: rename lru shrinker utilities 2024-05-29 20:51:37 +00:00
binder_internal.h FROMGIT: Binder: Add async from to transaction record 2023-06-07 14:25:07 +00:00
binder_trace.h UPSTREAM: binder: keep vma addresses type as unsigned long 2024-05-29 20:51:37 +00:00
binderfs.c binderfs: rework superblock destruction 2022-09-01 16:18:49 +02:00
debug_kinfo.c ANDROID: Add known structs used by modules to KMI 2024-04-16 13:49:35 -07:00
debug_kinfo.h ANDROID: debug_kinfo driver, move to drivers/android 2022-04-13 13:42:33 +02:00
Kconfig ANDROID: android: Create debug_symbols driver 2023-06-30 10:39:56 +00:00
Makefile ANDROID: android: Create debug_symbols driver 2023-06-30 10:39:56 +00:00
vendor_hooks.c Revert "ANDROID: Add vendor hooks for binder perf tuning" 2024-05-29 20:51:37 +00:00