On Tue, May 05, 2026 at 06:40:21PM +0200, Boris Brezillon wrote:
> On Tue, 5 May 2026 17:39:13 +0200
> Maxime Ripard <mripard(a)kernel.org> wrote:
>
> > Hi Boris,
> >
> > On Tue, May 05, 2026 at 05:20:48PM +0200, Boris Brezillon wrote:
> > > Hi Ketil,
> > >
> > > On Tue, 5 May 2026 16:05:07 +0200
> > > Ketil Johnsen <ketil.johnsen(a)arm.com> wrote:
> > >
> > > > From: John Stultz <jstultz(a)google.com>
> > > >
> > > > Add proper reference counting on the dma_heap structure. While
> > > > existing heaps are built-in, we may eventually have heaps loaded
> > > > from modules, and we'll need to be able to properly handle the
> > > > references to the heaps
> > >
> > > It's weird that this "heap as module" thing is mentioned here, but
> > > actual robustness to make this safe is not added in the commit or any
> > > of the following ones.
> > >
> > > >
> > > > Signed-off-by: John Stultz <jstultz(a)google.com>
> > > > Signed-off-by: T.J. Mercier <tjmercier(a)google.com>
> > > > Signed-off-by: Yong Wu <yong.wu(a)mediatek.com>
> > > > [Yong: Just add comment for "minor" and "refcount"]
> > > > Signed-off-by: Yunfei Dong <yunfei.dong(a)mediatek.com>
> > > > [Yunfei: Change reviewer's comments]
> > > > Signed-off-by: Florent Tomasin <florent.tomasin(a)arm.com>
> > > > [Florent: Rebase]
> > > > Signed-off-by: Ketil Johnsen <ketil.johnsen(a)arm.com>
> > > > [Ketil: Rebase]
> > > > ---
> > > > drivers/dma-buf/dma-heap.c | 29 +++++++++++++++++++++++++++++
> > > > include/linux/dma-heap.h | 2 ++
> > > > 2 files changed, 31 insertions(+)
> > > >
> > > > diff --git a/drivers/dma-buf/dma-heap.c b/drivers/dma-buf/dma-heap.c
> > > > index ac5f8685a6494..9fd365ddbd517 100644
> > > > --- a/drivers/dma-buf/dma-heap.c
> > > > +++ b/drivers/dma-buf/dma-heap.c
> > > > @@ -12,6 +12,7 @@
> > > > #include <linux/dma-heap.h>
> > > > #include <linux/err.h>
> > > > #include <linux/export.h>
> > > > +#include <linux/kref.h>
> > > > #include <linux/list.h>
> > > > #include <linux/nospec.h>
> > > > #include <linux/syscalls.h>
> > > > @@ -31,6 +32,7 @@
> > > > * @heap_devt: heap device node
> > > > * @list: list head connecting to list of heaps
> > > > * @heap_cdev: heap char device
> > > > + * @refcount: reference counter for this heap device
> > > > *
> > > > * Represents a heap of memory from which buffers can be made.
> > > > */
> > > > @@ -41,6 +43,7 @@ struct dma_heap {
> > > > dev_t heap_devt;
> > > > struct list_head list;
> > > > struct cdev heap_cdev;
> > > > + struct kref refcount;
> > > > };
> > > >
> > > > static LIST_HEAD(heap_list);
> > > > @@ -248,6 +251,7 @@ struct dma_heap *dma_heap_add(const struct dma_heap_export_info *exp_info)
> > > > if (!heap)
> > > > return ERR_PTR(-ENOMEM);
> > > >
> > > > + kref_init(&heap->refcount);
> > > > heap->name = exp_info->name;
> > > > heap->ops = exp_info->ops;
> > > > heap->priv = exp_info->priv;
> > > > @@ -313,6 +317,31 @@ struct dma_heap *dma_heap_add(const struct dma_heap_export_info *exp_info)
> > > > }
> > > > EXPORT_SYMBOL_NS_GPL(dma_heap_add, "DMA_BUF_HEAP");
> > > >
> > > > +static void dma_heap_release(struct kref *ref)
> > > > +{
> > > > + struct dma_heap *heap = container_of(ref, struct dma_heap, refcount);
> > > > + unsigned int minor = MINOR(heap->heap_devt);
> > > > +
> > > > + mutex_lock(&heap_list_lock);
> > > > + list_del(&heap->list);
> > > > + mutex_unlock(&heap_list_lock);
> > > > +
> > > > + device_destroy(dma_heap_class, heap->heap_devt);
> > > > + cdev_del(&heap->heap_cdev);
> > > > + xa_erase(&dma_heap_minors, minor);
> > > > +
> > > > + kfree(heap);
> > >
> > > That's actually problematic, because cdev_del() doesn't guarantee that
> > > all opened FDs have been closed [1], it just guarantees that no new ones
> > > can materialize. In order to make that safe, we'd need a
> > >
> > > 1. kref_get_unless_zero() in dma_heap_open(), with proper locking around
> > > the xa_load() to protect against the heap removal that's happening
> > > here
> > > 2. a dma_heap_put() in a new dma_heap_close() implementation
> > > 3. a guarantee that heap implementations won't go away until the last
> > > ref is dropped, which means ops and all the data needed for this heap
> > > to satisfy ioctl()s (and more generally every passed at
> > > dma_heap_add() time) have to stay valid until the last ref is
> > > dropped. Alternatively, we could restrict this only to in-flight
> > > ioctl()s, and have the ops replaced by some dummy ops using RCU or a
> > > rwlock. But I guess live dmabufs allocated on this heap have to
> > > retain the heap and its implementation anyway.
> > >
> > > For record, #3 is already not satisfied by the current tee_heap
> > > implementation (tee_dma_heap objects can vanish before the dma_heap
> > > object is gone). The other implementations seem to be fine because they
> > > are statically linked, and they either have exp_info.priv set to NULL,
> > > or something that's never released.
> >
> > That statement won't hold for long, see:
> > https://lore.kernel.org/r/20260427-dma-buf-heaps-as-modules-v5-0-b6f5678fee…
> >
> > However, all upstream heaps can be loaded as module, but not unloaded.
> > So once you get a reference to it, you can assume it will live forever.
> > That's why we didn't merge that patch before, even though it was discussed:
> >
> > https://lore.kernel.org/all/CANDhNCqk9Uk4aXHhUsL4hR1GHNmWZnH3C9Np-A02wdi+J3…
>
> Hm, not too sure that makes the tee_heap implementation sane WRT
> tee_heap removal though, unless we have a guarantee that
> tee_device_unregister() will never be called...
I missed that part. You're totally right then :)
Maxime
Modern mimarinin vazgeçilmez yapı elemanlarından biri haline gelen demir döner merdivenler, hem estetik görünümü hem de uzun ömürlü kullanımıyla yaşam alanlarına değer katmaktadır. Özellikle dar alanlarda maksimum kullanım avantajı sunan bu merdiven sistemleri, evlerden iş yerlerine, dubleks dairelerden villa projelerine kadar birçok farklı alanda tercih edilmektedir.
Dayanıklı metal yapısı sayesinde yüksek taşıma kapasitesine sahip olan demir döner merdiven modelleri, güvenli kullanım sunarken dekoratif tasarımlarıyla da dikkat çeker. Klasik, modern, endüstriyel veya minimalist dekorasyon stillerine uyum sağlayabilen bu özel merdivenler, mekânın atmosferini tamamen değiştirebilir.
Demir döner merdivenlerin en önemli avantajlarından biri yer tasarrufu sağlamasıdır. Geleneksel düz merdivenlere göre daha az alan kaplayan spiral tasarım, özellikle küçük metrekareli alanlarda büyük avantaj sunar. Bu sayede hem kullanışlı hem de şık bir geçiş alanı oluşturulur.
Üretim aşamasında kullanılan kaliteli demir malzeme, paslanmaya ve deformasyona karşı yüksek direnç sağlar. Elektrostatik boya uygulamaları sayesinde merdiven yüzeyi uzun yıllar ilk günkü görünümünü korur. İç mekân kullanımının yanı sıra dış mekân projelerinde de tercih edilen demir döner merdivenler, hava koşullarına dayanıklı yapısıyla güven verir.
Kişiye özel ölçülerde üretilebilen modeller sayesinde her projeye uygun çözümler sunulabilir. Basamak genişliği, korkuluk tasarımı, renk seçenekleri ve merdiven çapı tamamen ihtiyaca göre şekillendirilebilir. Ahşap basamak detaylarıyla sıcak bir görünüm elde edilebilirken tamamen metal tasarımlarla modern ve güçlü bir atmosfer oluşturulabilir.
Demir döner merdivenler sadece bir geçiş aracı değil, aynı zamanda dekoratif bir mimari unsur olarak da öne çıkar. Özellikle loft daireler, teras bağlantıları, çatı katları ve mağaza iç tasarımlarında estetik görünümüyle dikkat çekmektedir. Hem fonksiyonel hem de görsel açıdan güçlü bir çözüm arayanlar için ideal seçenekler arasında yer alır.
Uzun ömürlü kullanım, sağlam yapı, estetik görünüm ve alan tasarrufu avantajlarını bir araya getiren demir döner merdiven sistemleri, modern yaşam alanlarının vazgeçilmez tercihleri arasında yer almaktadır. Siz de yaşam alanınıza özel tasarlanmış kaliteli ve şık bir merdiven çözümü ile mekânlarınıza değer katabilirsiniz.
Demir döner merdiven https://fakrocatimerdivenleri.com/doner-merdivenler/
Fakro çatı merdivenleri, modern yaşam alanlarında çatı katına güvenli, konforlu ve pratik erişim sağlamak için geliştirilmiş yenilikçi çözümler arasında yer almaktadır. Dayanıklı yapısı, estetik tasarımı ve uzun ömürlü kullanım avantajı ile dikkat çeken Fakro çatı merdivenleri; evler, dubleks daireler, villalar, ofisler ve depo alanları için ideal bir kullanım sunar. Kullanılmadığı zaman katlanabilir yapısı sayesinde minimum alan kaplayan bu sistemler, yaşam alanlarında ekstra yer tasarrufu sağlamaktadır.
Fakro’nun geliştirdiği çatı merdiveni modelleri; ahşap, metal ve makaslı sistem seçenekleriyle farklı ihtiyaçlara hitap eder. Isı yalıtımlı kapak yapıları sayesinde enerji kaybını minimum seviyeye indirirken, özellikle kış aylarında iç mekan sıcaklığının korunmasına yardımcı olur. Kaymaz basamak yapısı ve sağlam menteşe sistemi ise kullanıcı güvenliğini üst seviyeye taşır. Böylece hem güvenli hem de ergonomik bir kullanım deneyimi elde edilir.
Kurulum açısından oldukça pratik olan Fakro çatı merdivenleri, tavan boşluklarına uyum sağlayan özel ölçü seçenekleri ile üretilmektedir. Tavana tam entegre olan yapısı sayesinde dekoratif açıdan da estetik bir görünüm sunar. Açılıp kapanma mekanizmasının kolay çalışması, günlük kullanım sırasında büyük avantaj sağlar. Özellikle dar alanlarda maksimum verim almak isteyen kullanıcılar için son derece işlevsel bir çözüm oluşturur.
Fakro ahşap çatı merdivenleri doğal görünümü ile yaşam alanlarına sıcak bir atmosfer kazandırırken, metal çatı merdivenleri yüksek taşıma kapasitesi ve dayanıklılığı ile öne çıkar. Makaslı alüminyum modeller ise kompakt yapıları sayesinde küçük tavan girişlerinde bile rahat kullanım imkanı sunmaktadır. Her modelde kalite standartlarının yüksek tutulması, ürünlerin uzun yıllar sorunsuz kullanılmasına katkı sağlar.
Fakro çatı merdivenleri https://www.fakrocatimerdivenleri.com
On Wed, May 06, 2026 at 04:55:27PM +0100, Matt Evans wrote:
> Hi Leon,
>
> On 06/05/2026 16:29, Leon Romanovsky wrote:
> >
> > On Wed, May 06, 2026 at 02:53:31PM +0100, Matt Evans wrote:
> > > Hi Alex,
> > >
> > > On 01/05/2026 20:12, Alex Williamson wrote:
> > > >
> > > > On Thu, 16 Apr 2026 06:17:44 -0700
> > > > Matt Evans <mattev(a)meta.com> wrote:
> > > >
> > > > > vfio_pci_dma_buf_cleanup() assumed all VFIO device DMABUFs need to be
> > > > > revoked. However, if vfio_pci_dma_buf_move() revokes DMABUFs before
> > > > > the fd/device closes, then vfio_pci_dma_buf_cleanup() would do a
> > > > > second/underflowing kref_put() then wait_for_completion() on a
> > > > > completion that never fires. Fixed by predicating on revocation
> > > > > status.
> > > > >
> > > > > This could happen if PCI_COMMAND_MEMORY is cleared before closing the
> > > > > device fd (but the scenario is more likely to hit when future commits
> > > > > add more methods to revoke DMABUFs).
> > > > >
> > > > > Fixes: 1a8a5227f2299 ("vfio: Wait for dma-buf invalidation to complete")
> > > > > Signed-off-by: Matt Evans <mattev(a)meta.com>
> > > > > ---
> > > > >
> > > > > (Just a fix, but later "vfio/pci: Convert BAR mmap() to use a DMABUF"
> > > > > and "vfio/pci: Permanently revoke a DMABUF on request" depend on this
> > > > > context, so including in this series.)
> > > >
> > > > We really need a fix for this split out from this series, It's already
> > > > been shown[1] that this is trivially reachable. Carlos proposed[2] a
> > > > similar solution to the one below. I was concurrently working on the
> > > > issued and suggested an alternative[3]. Let's pick a solution for
> > > > 7.1-rc. Thanks,
> > >
> > > It looks like [3] is progressing, so I'll drop this one when I can rebase
> > > onto it.
> > >
> > > I noticed [3] removes the dma_resv_lock(priv->dmabuf->resv) around the
> > > priv->vdev = NULL, and this series' vfio_pci_mmap_huge_fault() relies on
> > > vdev only changing whilst resv is held to resolve a race between a fault and
> > > cleanup (see patch 7 of this series). The handler takes resv so that it can
> > > stably test vdev in order to take memory_lock.
> >
> > I think that you should rely on priv->revoked and not on priv->vdev.
>
> Needs both unfortunately, as the fault handler ultimately needs to take
> vdev->memory_lock.
One can argue that if priv->revoked == True, all accesses to device
should be denied and treated as priv->vdev == Null.
Thanks
On 06/05/2026 11:45, Nicolas Frattaroli wrote:
> RAM is not, in fact, cheap. Especially on embedded systems with a low
> amount of memory, but known and well-defined userspace, more explicit
> resource management can lead to better utilisation patterns. As an
> example, a resource manager process on a purpose-built device may wish
> to launch, and then explicitly swap out, memory of processes that are
> kept "warm", to improve perceived startup latency of individual
> full-screen applications without making the kernel figure out the usage
> pattern from observation alone in order to swap out the right pages.
Have you considered memory control groups (memcg) for this purpose?
Imposing a lower limit than currently allocated should trigger reclaim,
so 'background' applications could have the limit lowered and then
restored when moved to the foreground.
> To allow for this explicit control in the context of panthor's GPU
> memory, add two new sysfs knobs. The first, mem_reclaim, runs an
> explicit priv BO reclaim cycle on the TGID written to it.
>
> The second, mem_claim, does the opposite: it swaps BOs back into active
> memory.
How necessary is this mem_claim for performance? Have you done any
benchmarking of explicitly claiming vs just allowing it to happen
naturally? My gut feeling is that mem_claim should be unnecessary in
most situations, but I'm prepared to be proved wrong.
I'm not saying this series is necessarily the wrong approach - but I
think we need a bit more justification for adding a new API for this.
Thanks,
Steve
> Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli(a)collabora.com>
> ---
> Nicolas Frattaroli (4):
> drm/panthor: Add freed_sz parameter to reclaim_priv_bos
> MAINTAINERS: Add sysfs ABI docs to list of panthor files
> drm/panthor: Add explicit memory reclaim sysfs knob
> drm/panthor: Add explicit memory claim sysfs knob
>
> Documentation/ABI/testing/sysfs-driver-panthor-mem | 34 ++++++++
> MAINTAINERS | 1 +
> drivers/gpu/drm/panthor/panthor_drv.c | 93 ++++++++++++++++++++++
> drivers/gpu/drm/panthor/panthor_gem.c | 7 +-
> drivers/gpu/drm/panthor/panthor_gem.h | 1 +
> drivers/gpu/drm/panthor/panthor_mmu.c | 70 +++++++++++++++-
> drivers/gpu/drm/panthor/panthor_mmu.h | 4 +
> 7 files changed, 205 insertions(+), 5 deletions(-)
> ---
> base-commit: 2c4b906cd135bbb44855287d0d0eff0ee0b47afe
> change-id: 20260506-panthor-explicit-reclaim-3dffed028d8c
>
> Best regards,
> --
> Nicolas Frattaroli <nicolas.frattaroli(a)collabora.com>
>
On Wed, May 06, 2026 at 02:53:31PM +0100, Matt Evans wrote:
> Hi Alex,
>
> On 01/05/2026 20:12, Alex Williamson wrote:
> >
> > On Thu, 16 Apr 2026 06:17:44 -0700
> > Matt Evans <mattev(a)meta.com> wrote:
> >
> > > vfio_pci_dma_buf_cleanup() assumed all VFIO device DMABUFs need to be
> > > revoked. However, if vfio_pci_dma_buf_move() revokes DMABUFs before
> > > the fd/device closes, then vfio_pci_dma_buf_cleanup() would do a
> > > second/underflowing kref_put() then wait_for_completion() on a
> > > completion that never fires. Fixed by predicating on revocation
> > > status.
> > >
> > > This could happen if PCI_COMMAND_MEMORY is cleared before closing the
> > > device fd (but the scenario is more likely to hit when future commits
> > > add more methods to revoke DMABUFs).
> > >
> > > Fixes: 1a8a5227f2299 ("vfio: Wait for dma-buf invalidation to complete")
> > > Signed-off-by: Matt Evans <mattev(a)meta.com>
> > > ---
> > >
> > > (Just a fix, but later "vfio/pci: Convert BAR mmap() to use a DMABUF"
> > > and "vfio/pci: Permanently revoke a DMABUF on request" depend on this
> > > context, so including in this series.)
> >
> > We really need a fix for this split out from this series, It's already
> > been shown[1] that this is trivially reachable. Carlos proposed[2] a
> > similar solution to the one below. I was concurrently working on the
> > issued and suggested an alternative[3]. Let's pick a solution for
> > 7.1-rc. Thanks,
>
> It looks like [3] is progressing, so I'll drop this one when I can rebase
> onto it.
>
> I noticed [3] removes the dma_resv_lock(priv->dmabuf->resv) around the
> priv->vdev = NULL, and this series' vfio_pci_mmap_huge_fault() relies on
> vdev only changing whilst resv is held to resolve a race between a fault and
> cleanup (see patch 7 of this series). The handler takes resv so that it can
> stably test vdev in order to take memory_lock.
I think that you should rely on priv->revoked and not on priv->vdev.
Thanks
>
> Must your fix change vdev outside of holding resv? I'm still sketching
> alternatives; at first glance perhaps the fault handler could rely on vdev
> being valid if !revoked, which can be tested holding [only] resv.
>
>
> Thanks,
>
> Matt
>
> >
> > Alex
> >
> > [1]https://lore.kernel.org/all/GVXPR02MB12019AA6014F27EF5D773E89BFB372@GVXPR…
> > [2]https://lore.kernel.org/all/20260429182736.409323-2-clopez@suse.de/
> > [3]https://lore.kernel.org/all/20260429142242.70f746b4@nvidia.com/
> >
> > > drivers/vfio/pci/vfio_pci_dmabuf.c | 9 +++++++--
> > > 1 file changed, 7 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/vfio/pci/vfio_pci_dmabuf.c b/drivers/vfio/pci/vfio_pci_dmabuf.c
> > > index 281ba7d69567..04478b7415a0 100644
> > > --- a/drivers/vfio/pci/vfio_pci_dmabuf.c
> > > +++ b/drivers/vfio/pci/vfio_pci_dmabuf.c
> > > @@ -395,20 +395,25 @@ void vfio_pci_dma_buf_cleanup(struct vfio_pci_core_device *vdev)
> > > down_write(&vdev->memory_lock);
> > > list_for_each_entry_safe(priv, tmp, &vdev->dmabufs, dmabufs_elm) {
> > > + bool was_revoked;
> > > +
> > > if (!get_file_active(&priv->dmabuf->file))
> > > continue;
> > > dma_resv_lock(priv->dmabuf->resv, NULL);
> > > list_del_init(&priv->dmabufs_elm);
> > > priv->vdev = NULL;
> > > + was_revoked = priv->revoked;
> > > priv->revoked = true;
> > > dma_buf_invalidate_mappings(priv->dmabuf);
> > > dma_resv_wait_timeout(priv->dmabuf->resv,
> > > DMA_RESV_USAGE_BOOKKEEP, false,
> > > MAX_SCHEDULE_TIMEOUT);
> > > dma_resv_unlock(priv->dmabuf->resv);
> > > - kref_put(&priv->kref, vfio_pci_dma_buf_done);
> > > - wait_for_completion(&priv->comp);
> > > + if (!was_revoked) {
> > > + kref_put(&priv->kref, vfio_pci_dma_buf_done);
> > > + wait_for_completion(&priv->comp);
> > > + }
> > > vfio_device_put_registration(&vdev->vdev);
> > > fput(priv->dmabuf->file);
> > > }
> >
>
On 06/05/2026 11:45, Nicolas Frattaroli wrote:
> panthor_mmu_reclaim_priv_bos returns the number of freed pages. However,
> how many bytes of freed memory this translates to can't generally be
> deduced from the number of pages, as the page size is a per-VM property.
>
> It may be useful to know the exact number of bytes that have been freed
The "useful" aspect seems to just be a drm_dbg() message from what I can
see with this series? Am I missing something or is it not actually that
useful?
Thanks,
Steve
> for observability and debugging purposes. To that end, add a new
> parameter "freed_sz", which is a pointer to a size_t where this
> information will be stored. It may be NULL, in which case the
> information isn't stored at all.
>
> Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli(a)collabora.com>
> ---
> drivers/gpu/drm/panthor/panthor_gem.c | 3 ++-
> drivers/gpu/drm/panthor/panthor_mmu.c | 12 ++++++++++--
> drivers/gpu/drm/panthor/panthor_mmu.h | 1 +
> 3 files changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/panthor/panthor_gem.c b/drivers/gpu/drm/panthor/panthor_gem.c
> index 13295d7a593d..80e82238f3c5 100644
> --- a/drivers/gpu/drm/panthor/panthor_gem.c
> +++ b/drivers/gpu/drm/panthor/panthor_gem.c
> @@ -1511,7 +1511,8 @@ panthor_gem_shrinker_scan(struct shrinker *shrinker, struct shrink_control *sc)
> goto out;
>
> freed += panthor_mmu_reclaim_priv_bos(ptdev, sc->nr_to_scan - freed,
> - &remaining, panthor_gem_try_evict);
> + &remaining, NULL,
> + panthor_gem_try_evict);
> if (freed >= sc->nr_to_scan)
> goto out;
>
> diff --git a/drivers/gpu/drm/panthor/panthor_mmu.c b/drivers/gpu/drm/panthor/panthor_mmu.c
> index a7ee14986849..b81388b35a58 100644
> --- a/drivers/gpu/drm/panthor/panthor_mmu.c
> +++ b/drivers/gpu/drm/panthor/panthor_mmu.c
> @@ -3127,13 +3127,18 @@ int panthor_vm_prepare_mapped_bos_resvs(struct drm_exec *exec, struct panthor_vm
> unsigned long
> panthor_mmu_reclaim_priv_bos(struct panthor_device *ptdev,
> unsigned int nr_to_scan, unsigned long *remaining,
> + size_t *freed_sz,
> bool (*shrink)(struct drm_gem_object *,
> struct ww_acquire_ctx *))
> {
> + unsigned long newly_freed;
> unsigned long freed = 0;
> LIST_HEAD(remaining_vms);
> LIST_HEAD(vms);
>
> + if (freed_sz)
> + *freed_sz = 0;
> +
> mutex_lock(&ptdev->reclaim.lock);
> list_splice_init(&ptdev->reclaim.vms, &vms);
>
> @@ -3152,8 +3157,11 @@ panthor_mmu_reclaim_priv_bos(struct panthor_device *ptdev,
>
> mutex_unlock(&ptdev->reclaim.lock);
>
> - freed += drm_gem_lru_scan(&vm->reclaim.lru, nr_to_scan - freed,
> - remaining, shrink, NULL);
> + newly_freed = drm_gem_lru_scan(&vm->reclaim.lru, nr_to_scan - freed,
> + remaining, shrink, NULL);
> + if (freed_sz)
> + *freed_sz += panthor_vm_page_size(vm) * newly_freed;
> + freed += newly_freed;
>
> mutex_lock(&ptdev->reclaim.lock);
>
> diff --git a/drivers/gpu/drm/panthor/panthor_mmu.h b/drivers/gpu/drm/panthor/panthor_mmu.h
> index 3522fbbce369..12b18b5f90e1 100644
> --- a/drivers/gpu/drm/panthor/panthor_mmu.h
> +++ b/drivers/gpu/drm/panthor/panthor_mmu.h
> @@ -52,6 +52,7 @@ int panthor_vm_evict_bo_mappings_locked(struct panthor_gem_object *bo);
> unsigned long
> panthor_mmu_reclaim_priv_bos(struct panthor_device *ptdev,
> unsigned int nr_to_scan, unsigned long *remaining,
> + size_t *freed_sz,
> bool (*shrink)(struct drm_gem_object *,
> struct ww_acquire_ctx *));
> int panthor_vm_prepare_mapped_bos_resvs(struct drm_exec *exec,
>