summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeung-Woo Kim <sw0312.kim@samsung.com>2022-09-22 13:31:10 +0900
committerSeung-Woo Kim <sw0312.kim@samsung.com>2022-09-22 19:20:55 +0900
commitb8b554984bc0332a4668242a15b05ad539a0fa50 (patch)
tree5d009a38385eb9dece0fca7b73ad6436bd6ac6ba
parent2b582d8b60b7d5059a0e83909978c1086103aabc (diff)
downloadmemps-b8b554984bc0332a4668242a15b05ad539a0fa50.tar.gz
memps-b8b554984bc0332a4668242a15b05ad539a0fa50.tar.bz2
memps-b8b554984bc0332a4668242a15b05ad539a0fa50.zip
Remove mmap size of drm render node as like drm node
If drm render is used as gpu, its mmap size needs to be removed from total rss because it is already in 3d graphic memory. Remove mmap size of drm render node. Change-Id: I483c261efa76e04c58b45739cea7bac1f80e743f Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
-rw-r--r--memps.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/memps.c b/memps.c
index d8e81f4..2504cd8 100644
--- a/memps.c
+++ b/memps.c
@@ -41,6 +41,7 @@
#define STR_DRM_PATH1 "/drm mm object (deleted)"
#define STR_DRM_PATH2 "/dev/dri/card"
#define STR_DRM_DBG_DIR "/sys/kernel/debug/dri/"
+#define STR_DRM_RENDER_PATH "/dev/dri/renderD"
#define MEMCG_PATH "/sys/fs/cgroup/memory"
#define ZRAM_USED_PATH "/sys/block/zram0/mem_used_total"
#define ZRAM_MM_STAT_PATH "/sys/block/zram0/mm_stat"
@@ -107,6 +108,7 @@ struct trib_mapinfo {
unsigned peak_rss;
unsigned other_devices;
unsigned gem_mmap;
+ unsigned render_gem_mmap;
};
struct geminfo {
@@ -820,6 +822,7 @@ static void init_trib_mapinfo(trib_mapinfo *tmi)
tmi->peak_rss = 0;
tmi->other_devices = 0;
tmi->gem_mmap = 0;
+ tmi->render_gem_mmap = 0;
}
unsigned int get_graphic_3d_meminfo(unsigned int tgid)
@@ -881,6 +884,9 @@ get_trib_mapinfo(unsigned int tgid, mapinfo *milist,
!strncmp(mi->name, STR_DRM_PATH2,
sizeof(STR_DRM_PATH2))) {
result->gem_mmap += mi->rss;
+ } else if (!strncmp(mi->name, STR_DRM_RENDER_PATH,
+ sizeof(STR_DRM_RENDER_PATH))) {
+ result->render_gem_mmap += mi->rss;
} else {
result->shared_clean += mi->shared_clean;
result->shared_dirty += mi->shared_dirty;
@@ -910,6 +916,8 @@ get_trib_mapinfo(unsigned int tgid, mapinfo *milist,
result->peak_rss = result->rss;
if (result->gem_mmap > 0)
result->peak_rss -= result->gem_mmap;
+ if (result->render_gem_mmap > 0)
+ result->peak_rss -= result->render_gem_mmap;
gi = find_geminfo(tgid, gilist);
if (gi != NULL) {