Commit 378bede4 authored by T.J. Mercier's avatar T.J. Mercier
Browse files

ANDROID: Track per-process dmabuf PSS



DMA buffers exist for sharing memory, so dividing a buffer's size by the
number of processes with references to it to obtain proportional set
size is a useful metric for understanding an individual process's share
of system-wide dmabuf memory.

Dmabuf memory is not guaranteed to be representable by struct pages, and
a process may hold only file descriptor references to a buffer. So PSS
cannot be calculated on a per-page basis, and PSS accounting is always
performed in units of the full buffer size, and only once for each
process regardless of the number and type of references a process has
for a single buffer.

The /proc/<pid>/dmabuf_pss file in procfs now reports the sum of all
buffer PSS values referenced by a process. The units are bytes. This
allows userspace to obtain per-process dmabuf accounting information
quickly compared to calculating it from multiple sources in procfs and
sysfs.

Note that a dmabuf can be backed by different types of memory such as
system DRAM, GPU VRAM, or others. This patch makes no distinction
between these different types of memory, so on systems with non-unified
memory the reported values should be interpreted with this in mind.

Bug: 424648392
Bug: 441733128
Change-Id: Ie16b92b76ef2a4fc3a3e9bdb7c8a793a80aac0e3
Signed-off-by: default avatarT.J. Mercier <tjmercier@google.com>
parent b21e60d3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment