Re: [PATCH 2/2] drm/panthor: Implement evicted status for GEM objects

From: Boris Brezillon

Date: Tue Apr 21 2026 - 03:30:37 EST


On Mon, 20 Apr 2026 19:46:52 +0200
Nicolas Frattaroli <nicolas.frattaroli@xxxxxxxxxxxxx> wrote:

> > > +
> > > panthor_gem_dev_map_cleanup_locked(bo);
> > > panthor_gem_backing_cleanup_locked(bo);
> > > panthor_gem_update_reclaim_state_locked(bo, NULL);
> > > @@ -788,6 +792,8 @@ static enum drm_gem_object_status panthor_gem_status(struct drm_gem_object *obj)
> > >
> > > if (drm_gem_is_imported(&bo->base) || bo->backing.pages)
> > > res |= DRM_GEM_OBJECT_RESIDENT;
> > > + else if (atomic_read(&bo->reclaimed_count))
> > > + res |= DRM_GEM_OBJECT_EVICTED;
> > >
> > > return res;
> > > }
> > > @@ -1595,6 +1601,7 @@ static void panthor_gem_debugfs_print_flag_names(struct seq_file *m)
> > > static const char * const gem_state_flags_names[] = {
> > > [PANTHOR_DEBUGFS_GEM_STATE_IMPORTED_BIT] = "imported",
> > > [PANTHOR_DEBUGFS_GEM_STATE_EXPORTED_BIT] = "exported",
> > > + [PANTHOR_DEBUGFS_GEM_STATE_EVICTED_BIT] = "evicted",
> > > };
> > >
> > > static const char * const gem_usage_flags_names[] = {
> > > @@ -1648,6 +1655,9 @@ static void panthor_gem_debugfs_bo_print(struct panthor_gem_object *bo,
> > >
> > > if (drm_gem_is_imported(&bo->base))
> > > gem_state_flags |= PANTHOR_DEBUGFS_GEM_STATE_FLAG_IMPORTED;
> > > + else if (!resident_size && atomic_read(&bo->reclaimed_count))
> > > + gem_state_flags |= PANTHOR_DEBUGFS_GEM_STATE_FLAG_EVICTED;
> >
> > I think it'd be interesting to know the number of times a BO got
> > evicted.
>
> Agreed. Should I add that as a separate column?

Yes

> I think I'll keep the
> state flag even if I add a column, because even if it's technically
> redundant, it'll still be useful to see without having to compare
> three different columns.

Sure, keeping the "evicted" flag is fine.