diff options
| author | Shivam Kalra <shivamkalra98@zohomail.in> | 2026-02-16 17:09:57 +0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-02-27 08:37:53 +0300 |
| commit | 34268365a9e9424e38083c8f318cc34b153dcb07 (patch) | |
| tree | d127e43544e6b2487eb90a75b8b7ec78aa54db5d /include/linux/platform_data | |
| parent | fbfc0d615368ddf71899dbea2205e741c79b23e8 (diff) | |
| download | linux-34268365a9e9424e38083c8f318cc34b153dcb07.tar.xz | |
rust_binder: shrink all_procs when deregistering processes
When a process is deregistered from the binder context, the all_procs
vector may have significant unused capacity. Add logic to shrink the
vector using a conservative strategy that prevents shrink-then-regrow
oscillation.
The shrinking strategy triggers when length drops below 1/4 of capacity,
and shrinks to twice the current length rather than to the exact length.
This provides hysteresis to avoid repeated reallocations when the process
count fluctuates.
The shrink operation uses GFP_KERNEL and is allowed to fail gracefully
since it is purely an optimization. The vector remains valid and
functional even if shrinking fails.
Suggested-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Shivam Kalra <shivamkalra98@zohomail.in>
Acked-by: Danilo Krummrich <dakr@kernel.org>
Link: https://patch.msgid.link/20260216-binder-shrink-vec-v3-v6-3-ece8e8593e53@zohomail.in
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/platform_data')
0 files changed, 0 insertions, 0 deletions
