dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Osipenko <dmitry.osipenko@collabora.com>
To: "Thomas Zimmermann" <tzimmermann@suse.de>,
	"David Airlie" <airlied@gmail.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Gurchetan Singh" <gurchetansingh@chromium.org>,
	"Chia-I Wu" <olvaffe@gmail.com>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Daniel Almeida" <daniel.almeida@collabora.com>,
	"Gustavo Padovan" <gustavo.padovan@collabora.com>,
	"Daniel Stone" <daniel@fooishbar.org>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Rob Clark" <robdclark@gmail.com>,
	"Sumit Semwal" <sumit.semwal@linaro.org>,
	"Christian König" <christian.koenig@amd.com>,
	"Qiang Yu" <yuq825@gmail.com>,
	"Steven Price" <steven.price@arm.com>,
	"Alyssa Rosenzweig" <alyssa.rosenzweig@collabora.com>,
	"Rob Herring" <robh@kernel.org>, "Sean Paul" <sean@poorly.run>,
	"Dmitry Baryshkov" <dmitry.baryshkov@linaro.org>,
	"Abhinav Kumar" <quic_abhinavk@quicinc.com>
Cc: kernel@collabora.com, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org,
	virtualization@lists.linux-foundation.org
Subject: Re: [PATCH v10 07/11] drm/shmem-helper: Switch to reservation lock
Date: Fri, 17 Feb 2023 16:33:00 +0300	[thread overview]
Message-ID: <c185946a-0a59-9f6e-9592-20b93f45514e@collabora.com> (raw)
In-Reply-To: <ca7e1d45-8843-8ae1-de0b-3f917e84b41e@suse.de>

On 2/17/23 15:52, Thomas Zimmermann wrote:
> Hi
> 
> Am 08.01.23 um 22:04 schrieb Dmitry Osipenko:
>> Replace all drm-shmem locks with a GEM reservation lock. This makes locks
>> consistent with dma-buf locking convention where importers are
>> responsible
>> for holding reservation lock for all operations performed over dma-bufs,
>> preventing deadlock between dma-buf importers and exporters.
>>
>> Suggested-by: Daniel Vetter <daniel@ffwll.ch>
>> Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
> 
> How much testing has this patch seen?
> 
> I'm asking because when I tried to fix the locking in this code, I had
> to review every importer to make sure that it aquired the lock. Has this
> problem been resolved?

The dma-buf locking rules was merged to v6.2 kernel.

I tested all the available importers that use drm-shmem. There were
deadlocks and lockdep warnings while I was working/testing the importer
paths in the past, feel confident that the code paths were tested well
enough. Note that Lima and Panfrost always use the importer paths in
case of display because display is a separate driver.

I checked that:

- desktop environment works
- 3d works
- video dec (v4l2) dmabuf sharing works
- shrinker works

I.e. tested it all with VirtIO-GPU, Panfrost and Lima drivers. For
VirtIO-GPU importer paths aren't relevant because it can only share bufs
with other virtio driver and in upstream we only have VirtIO-GPU driver
supporting dma-bufs.

-- 
Best regards,
Dmitry


  reply	other threads:[~2023-02-17 13:33 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-08 21:04 [PATCH v10 00/11] Add generic memory shrinker to VirtIO-GPU and Panfrost DRM drivers Dmitry Osipenko
2023-01-08 21:04 ` [PATCH v10 01/11] drm/msm/gem: Prevent blocking within shrinker loop Dmitry Osipenko
2023-02-17 12:02   ` Thomas Zimmermann
2023-02-27  4:27     ` Dmitry Osipenko
2023-01-08 21:04 ` [PATCH v10 02/11] drm/panfrost: Don't sync rpm suspension after mmu flushing Dmitry Osipenko
2023-01-08 21:04 ` [PATCH v10 03/11] drm/gem: Add evict() callback to drm_gem_object_funcs Dmitry Osipenko
2023-02-17 12:23   ` Thomas Zimmermann
2023-01-08 21:04 ` [PATCH v10 04/11] drm/shmem: Put booleans in the end of struct drm_gem_shmem_object Dmitry Osipenko
2023-02-17 12:25   ` Thomas Zimmermann
2023-01-08 21:04 ` [PATCH v10 05/11] drm/shmem: Switch to use drm_* debug helpers Dmitry Osipenko
2023-01-26 12:15   ` Gerd Hoffmann
2023-02-17 12:28   ` Thomas Zimmermann
2023-01-08 21:04 ` [PATCH v10 06/11] drm/shmem-helper: Don't use vmap_use_count for dma-bufs Dmitry Osipenko
2023-01-26 12:17   ` Gerd Hoffmann
2023-01-26 12:24     ` Dmitry Osipenko
2023-01-27  8:06       ` Gerd Hoffmann
2023-02-17 12:41   ` Thomas Zimmermann
2023-01-08 21:04 ` [PATCH v10 07/11] drm/shmem-helper: Switch to reservation lock Dmitry Osipenko
2023-02-17 12:52   ` Thomas Zimmermann
2023-02-17 13:33     ` Dmitry Osipenko [this message]
2023-02-17 13:29   ` Thomas Zimmermann
2023-01-08 21:04 ` [PATCH v10 08/11] drm/shmem-helper: Add memory shrinker Dmitry Osipenko
2023-02-17 13:19   ` Thomas Zimmermann
2023-02-27  4:34     ` Dmitry Osipenko
2023-01-08 21:04 ` [PATCH v10 09/11] drm/gem: Add drm_gem_pin_unlocked() Dmitry Osipenko
2023-02-17 13:42   ` Thomas Zimmermann
2023-01-08 21:04 ` [PATCH v10 10/11] drm/virtio: Support memory shrinking Dmitry Osipenko
2023-01-27  8:04   ` Gerd Hoffmann
2023-01-08 21:04 ` [PATCH v10 11/11] drm/panfrost: Switch to generic memory shrinker Dmitry Osipenko
2023-01-25 22:55 ` [PATCH v10 00/11] Add generic memory shrinker to VirtIO-GPU and Panfrost DRM drivers Dmitry Osipenko
2023-01-27  8:13   ` Gerd Hoffmann
2023-01-30 12:02     ` Dmitry Osipenko
2023-02-16 12:15       ` Daniel Vetter
2023-02-16 13:08         ` AngeloGioacchino Del Regno
2023-02-16 20:43         ` Dmitry Osipenko
2023-02-16 22:07           ` Daniel Vetter
2023-02-17 13:28 ` Thomas Zimmermann
2023-02-17 13:41   ` Dmitry Osipenko
2023-02-27  4:19     ` Dmitry Osipenko
2023-02-27 10:37       ` Jani Nikula
2023-02-27 11:00         ` Dmitry Osipenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c185946a-0a59-9f6e-9592-20b93f45514e@collabora.com \
    --to=dmitry.osipenko@collabora.com \
    --cc=airlied@gmail.com \
    --cc=alyssa.rosenzweig@collabora.com \
    --cc=christian.koenig@amd.com \
    --cc=daniel.almeida@collabora.com \
    --cc=daniel@ffwll.ch \
    --cc=daniel@fooishbar.org \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gurchetansingh@chromium.org \
    --cc=gustavo.padovan@collabora.com \
    --cc=kernel@collabora.com \
    --cc=kraxel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=olvaffe@gmail.com \
    --cc=quic_abhinavk@quicinc.com \
    --cc=robdclark@gmail.com \
    --cc=robh@kernel.org \
    --cc=sean@poorly.run \
    --cc=steven.price@arm.com \
    --cc=sumit.semwal@linaro.org \
    --cc=tzimmermann@suse.de \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=yuq825@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).