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

Commit b631927c authored by Isaac J. Manjarres's avatar Isaac J. Manjarres
Browse files

Improve lost RAM calculation by removing kernel driver CMA allocations



CMA memory can be in one of the following four states at any given
point in time:

1. Free, in which case it is already accounted for when computing
   lost RAM, since lost RAM subtracts free memory from total memory.

2. Allocated to userspace processes, in which case the memory has
   already been accounted for when computing lost RAM as part of the
   total PSS value that is computed.

3. Allocated for storing compressed memory (ZRAM) on Android kernels.
   This is already accounted for in the lost RAM calculation, since
   the calculation includes the memory consumed by ZRAM.

4. Allocated to a kernel driver, in which case the memory is not
   accounted for with the current kernel memory usage calculation.
   This memory ends up being counted as lost RAM.

Android exposes an interface that can be used to calculate how much
memory kernel drivers are allocating through CMA. Therefore, use
this interface to calculate this value, and improve the lost RAM
calculation.

Bug: 371518137
Bug: 228238851
Change-Id: Ia37ffbf861ac01708d90a10f0c76df745a33597d
Signed-off-by: default avatarIsaac J. Manjarres <isaacmanjarres@google.com>
parent fda96163
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment