[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4ce1e172-799c-cba3-0a72-4a6fdf2c6d2f@suse.de>
Date: Wed, 9 Mar 2022 09:59:18 +0100
From: Thomas Zimmermann <tzimmermann@...e.de>
To: Dmitry Osipenko <dmitry.osipenko@...labora.com>,
David Airlie <airlied@...ux.ie>,
Gerd Hoffmann <kraxel@...hat.com>,
Gurchetan Singh <gurchetansingh@...omium.org>,
Chia-I Wu <olvaffe@...il.com>, Daniel Vetter <daniel@...ll.ch>,
Daniel Almeida <daniel.almeida@...labora.com>,
Gert Wollny <gert.wollny@...labora.com>
Cc: Tomeu Vizoso <tomeu.vizoso@...labora.com>,
linux-kernel@...r.kernel.org,
virtualization@...ts.linux-foundation.org,
Gustavo Padovan <gustavo.padovan@...labora.com>,
dri-devel@...ts.freedesktop.org, Dmitry Osipenko <digetx@...il.com>
Subject: Re: [PATCH v1 0/5] Add memory shrinker to VirtIO-GPU DRM driver
Hi
Am 08.03.22 um 14:17 schrieb Dmitry Osipenko:
> Hello,
>
> This patchset introduces memory shrinker for the VirtIO-GPU DRM driver.
> During OOM, the shrinker will release BOs that are marked as "not needed"
> by userspace using the new madvise IOCTL. The userspace in this case is
> the Mesa VirGL driver, it will mark the cached BOs as "not needed",
> allowing kernel driver to release memory of the cached shmem BOs on lowmem
> situations, preventing OOM kills.
Virtio-gpu is build on top of GEM shmem helpers. I have a prototype
patchset that adds a shrinker to these helpers. If you want to go
further, you could implement something like that instead. Panfrost and
lima also have their own shrinker and could certainly be converted to
the gem-shmem shrinker.
Best regards
Thomas
>
> This patchset includes couple fixes for problems I found while was working
> on the shrinker, it also includes prerequisite DMA API usage improvement
> needed by the shrinker.
>
> The Mesa and IGT patches will be kept on hold until this kernel series
> will be approved and applied.
>
> This patchset was tested using Qemu and crosvm, including both cases of
> IOMMU off/on.
>
> Mesa: https://gitlab.freedesktop.org/digetx/mesa/-/commits/virgl-madvise
> IGT: https://gitlab.freedesktop.org/digetx/igt-gpu-tools/-/tree/virtio-madvise
>
> Dmitry Osipenko (5):
> drm/virtio: Correct drm_gem_shmem_get_sg_table() error handling
> drm/virtio: Check whether transferred 2D BO is shmem
> drm/virtio: Unlock GEM reservations in error code path
> drm/virtio: Improve DMA API usage for shmem BOs
> drm/virtio: Add memory shrinker
>
> drivers/gpu/drm/virtio/Makefile | 3 +-
> drivers/gpu/drm/virtio/virtgpu_drv.c | 22 +++-
> drivers/gpu/drm/virtio/virtgpu_drv.h | 31 ++++-
> drivers/gpu/drm/virtio/virtgpu_gem.c | 84 ++++++++++++
> drivers/gpu/drm/virtio/virtgpu_gem_shrinker.c | 124 ++++++++++++++++++
> drivers/gpu/drm/virtio/virtgpu_ioctl.c | 37 ++++++
> drivers/gpu/drm/virtio/virtgpu_kms.c | 17 ++-
> drivers/gpu/drm/virtio/virtgpu_object.c | 63 +++------
> drivers/gpu/drm/virtio/virtgpu_plane.c | 17 ++-
> drivers/gpu/drm/virtio/virtgpu_vq.c | 30 +++--
> include/uapi/drm/virtgpu_drm.h | 14 ++
> 11 files changed, 373 insertions(+), 69 deletions(-)
> create mode 100644 drivers/gpu/drm/virtio/virtgpu_gem_shrinker.c
>
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
Download attachment "OpenPGP_signature" of type "application/pgp-signature" (841 bytes)
Powered by blists - more mailing lists