Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 8a7d616b authored by Jared Duke's avatar Jared Duke
Browse files

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
parent 042df8f0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment