linux/drivers/android
Carlos Llamas 67dcc88078 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>
2023-12-05 09:23:40 +09:00
..
binder_alloc_selftest.c binder: rename lru shrinker utilities 2023-12-05 09:23:40 +09:00
binder_alloc.c binder: document the final page calculation 2023-12-05 09:23:40 +09:00
binder_alloc.h binder: rename lru shrinker utilities 2023-12-05 09:23:40 +09:00
binder_internal.h Binder: Add async from to transaction record 2023-05-13 20:38:12 +09:00
binder_trace.h binder: keep vma addresses type as unsigned long 2023-12-05 09:23:38 +09:00
binder.c binder: remove pid param in binder_alloc_new_buf() 2023-12-05 09:23:39 +09:00
binderfs.c Char/Misc and other driver changes for 6.7-rc1 2023-11-03 14:51:08 -10:00
Kconfig remove CONFIG_ANDROID 2022-07-01 10:41:09 +02:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00