summaryrefslogtreecommitdiff
path: root/libs/androidfw/ZipFileRO.cpp
diff options
context:
space:
mode:
author Jared Duke <jdduke@google.com> 2023-09-29 22:06:43 +0000
committer Jared Duke <jdduke@google.com> 2023-10-10 19:04:45 +0000
commit8a7d616b967a75154d946f7b534b0b9c96db2c47 (patch)
tree909baf6d4d47f8a37656a73209d0c79bacb9ca1d /libs/androidfw/ZipFileRO.cpp
parent042df8f083c3e6e6feec057ac52dc78d4ad3e46b (diff)
PinnerService: Update support for pinning anon regions
This change does the following: * Fixes refresh of anon region pinning - The pinAnonRegion method was being called multiple times redundantly (e.g., for different users, or during startup). This resulted in duplicate pinnings of the same region size, potentially 3-4x the requested memory after a single boot. This is not safe even for experiments. Update behavior to listen to config changes and refresh accordingly, including releasing memory if the experiment flag is reset. * Changes the mapping from MAP_PRIVATE to MAP_SHARED - This avoids issues w/ downstream telemetry where rss.anon values (as read from /proc/*/status) trigger behavior like heap dumps/profiles. The memory region is still anonymous, and even appears as private dirty in showmap/dumpsys meminfo (due to the invalidating setMemory() call on the shared anon buffer), but in perfetto memory accounting, it falls under `mem.rss.shmem`. * Renames pin_anon_size to pin_shared_anon_size - As it's not safe to use the previous flag due to (1), and the semantics are changed slightly in (2), introduce a different name. Bug: 294079161 Test: device_config put runtime_native_boot \ pin_shared_anon_size 2000000000 Test: device_config put runtime_native_boot \ pin_shared_anon_size 0 Test: device_config delete runtime_native_boot \ pin_shared_anon_size Test: showmap `pidof system_server` Test: cat /proc/`pidof system_server`/status | grep 'Rss' Change-Id: I7c7c0dc76b9ff04c9cd05de25bfaed65372a56a0
Diffstat (limited to 'libs/androidfw/ZipFileRO.cpp')
0 files changed, 0 insertions, 0 deletions