Commit 45fc2c87 authored by Joel Fernandes's avatar Joel Fernandes Committed by Shibin George
Browse files

Replace ashmem in ART with prctl

ART use ashmem just for naming anonymous regions. This is a hack.
Further, we are moving away from ashmem in favor of native Linux based
shared-memory mechanims for Android. We already have a PRCTL for naming
maps in the Android kernels. Lets use that for Android.

This also results in removal of ashmem hacks for host-only builds.

As a side-effect, the naming of regions change from "/dev/ashmem/<name>"
to "[anon:<name>" so we need to update debug code in frameworks. Another
CL does that.

Note: The user pointers passed to the prctl should be available during
maps read time, so we cannot use pointers from the stack. To solve this,
we maintain an std::map of unique debug strings when we name the maps.
This doesn't result in more memory usage than before, since ashmem is
heavier storage-wise due to additional kernel data structure
allocations.

Performance of 'dumpsys meminfo' gone up by 25% (1s to 0.75s). Slab
memory consumption gone down by 3-5MB on boot.

Test: Boot and dumpsys meminfo before/after
Bug: 111903542
Internal CL: ag/4827680

(cherry picked from commit 92597a8e)
Fix merge conflicts in "Replace ashmem in ART with prctl" (AOSP patch 736091)

Bug: 113888533

CRs-Fixed: 2359961

Change-Id: Ib4065e2c95004cb2df4c8eebc3edea5a9c1f9932
parent e0b929fc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment