linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/panfrost: Print RSS for tiler heap BO's in debugfs GEMS file
@ 2025-07-31 17:35 Adrián Larumbe
  2025-08-06 15:19 ` Daniel Stone
  0 siblings, 1 reply; 3+ messages in thread
From: Adrián Larumbe @ 2025-07-31 17:35 UTC (permalink / raw)
  To: linux-kernel
  Cc: dri-devel, Boris Brezillon, kernel, Adrián Larumbe,
	Rob Herring, Steven Price, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Simona Vetter

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

Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com>
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(-)

diff --git a/drivers/gpu/drm/panfrost/panfrost_gem.c b/drivers/gpu/drm/panfrost/panfrost_gem.c
index bb73f2a68a12..da7613801ac0 100644
--- a/drivers/gpu/drm/panfrost/panfrost_gem.c
+++ b/drivers/gpu/drm/panfrost/panfrost_gem.c
@@ -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
-- 
2.50.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/panfrost: Print RSS for tiler heap BO's in debugfs GEMS file
  2025-07-31 17:35 [PATCH] drm/panfrost: Print RSS for tiler heap BO's in debugfs GEMS file Adrián Larumbe
@ 2025-08-06 15:19 ` Daniel Stone
  2025-08-06 17:46   ` Adrián Larumbe
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Stone @ 2025-08-06 15:19 UTC (permalink / raw)
  To: Adrián Larumbe
  Cc: linux-kernel, dri-devel, Boris Brezillon, kernel, Rob Herring,
	Steven Price, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Simona Vetter

Hi Adrián,

On Thu, 31 Jul 2025 at 18:36, Adrián Larumbe
<adrian.larumbe@collabora.com> wrote:
> @@ -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:
Reviewed-by: Daniel Stone <daniels@collabora.com>

Cheers,
Daniel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/panfrost: Print RSS for tiler heap BO's in debugfs GEMS file
  2025-08-06 15:19 ` Daniel Stone
@ 2025-08-06 17:46   ` Adrián Larumbe
  0 siblings, 0 replies; 3+ messages in thread
From: Adrián Larumbe @ 2025-08-06 17:46 UTC (permalink / raw)
  To: Daniel Stone
  Cc: linux-kernel, dri-devel, Boris Brezillon, kernel, Rob Herring,
	Steven Price, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Simona Vetter

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

On Thu, 31 Jul 2025 at 18:36, Adrián Larumbe
> <adrian.larumbe@collabora.com> wrote:
> > @@ -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.

>
> With that:
> Reviewed-by: Daniel Stone <daniels@collabora.com>
>
> Cheers,
> Daniel

Adrian Larumbe

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-08-06 17:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-31 17:35 [PATCH] drm/panfrost: Print RSS for tiler heap BO's in debugfs GEMS file Adrián Larumbe
2025-08-06 15:19 ` Daniel Stone
2025-08-06 17:46   ` Adrián Larumbe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).