Skip to contentSkip to conversation

drm/panfrost: Print RSS for tiler heap BO's in debugfs GEMS file

PATCH Superseded Adrián Larumbe 2 participants 3 messages Jul 31, 2025 – Aug 6, 2025

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Adrián Larumbe

author maintainer
#0 lore raw

PATCH 1/1 drm/panfrost: Print RSS for tiler heap BO's in debugfs GEMS file

Otherwise it would display the virtual allocation size, which is often much bigger than the RSS.

Fixes e48ade5e23ba ("drm/panfrost: show device-wide list of DRM GEM objects over DebugFS")
---
 drivers/gpu/drm/panfrost/panfrost_gem.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/panfrost/panfrost_gem.c +2 -1
index bb73f2a68a12..da7613801ac0 100644
@@ -432,7 +432,8 @@ static void panfrost_gem_debugfs_bo_print(struct panfrost_gem_object *bo,
 	if (!refcount)
 		return;
 
-	resident_size = bo->base.pages ? bo->base.base.size : 0;
+	resident_size = bo->base.pages ?
+		(bo->is_heap ? bo->heap_rss_size : bo->base.base.size) : 0;
 
 	snprintf(creator_info, sizeof(creator_info),
 		 "%s/%d", bo->debugfs.creator.process_name, bo->debugfs.creator.tgid);

base-commit: 934452cbb16e1e3609ba52acb48c503b9aaf3154

Signature · 1 line
2.50.0
Reviewed-by on v1 1/1
#1 lore raw

Hi Adrián,

drivers/gpu/drm/panfrost/panfrost_gem.c static void panfrost_gem_debugfs_bo_print(struct panfrost_gem_object *bo, · line 436

Quoted 7 lines · Adrián Larumbe
drivers/gpu/drm/panfrost/panfrost_gem.c +2 -1
@@ -432,7 +432,8 @@ static void panfrost_gem_debugfs_bo_print(struct panfrost_gem_object *bo,
        if (!refcount)
                return;
 
-       resident_size = bo->base.pages ? bo->base.base.size : 0;
+       resident_size = bo->base.pages ?
+               (bo->is_heap ? bo->heap_rss_size : bo->base.base.size) : 0;

Just use panfrost_gem_rss() here, though you'll need to make it non-static.

With that:

Cheers,
Daniel

author maintainer
#2 lore raw

On 06.08.2025 16:19, Daniel Stone wrote:
Hi Adrián,

On Thu, 31 Jul 2025 at 18:36, Adrián Larumbe

Quoted 10 lines

drivers/gpu/drm/panfrost/panfrost_gem.c static void panfrost_gem_debugfs_bo_print(struct panfrost_gem_object *bo, · line 436

Quoted 7 lines · <[email protected]> wrote:
drivers/gpu/drm/panfrost/panfrost_gem.c +2 -1
@@ -432,7 +432,8 @@ static void panfrost_gem_debugfs_bo_print(struct panfrost_gem_object *bo,
        if (!refcount)
                return;
 
-       resident_size = bo->base.pages ? bo->base.base.size : 0;
+       resident_size = bo->base.pages ?
+               (bo->is_heap ? bo->heap_rss_size : bo->base.base.size) : 0;

Just use panfrost_gem_rss() here, though you'll need to make it non-static.

It's still within the same compilation unit (panfrost_gem.c) so it can remain static.

Quoted 6 lines

With that:

Cheers,
Daniel

Adrian Larumbe