Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Osipenko <dmitry.osipenko@collabora.com>
To: Emil Velikov <emil.l.velikov@gmail.com>
Cc: dri-devel@lists.freedesktop.org,
	"John Stultz" <jstultz@google.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	kernel@collabora.com, "Sumit Semwal" <sumit.semwal@linaro.org>,
	"Marek Szyprowski" <m.szyprowski@samsung.com>,
	"Benjamin Gaignard" <benjamin.gaignard@collabora.com>,
	linux-media@vger.kernel.org, "Daniel Vetter" <daniel@ffwll.ch>,
	"Arnd Bergmann" <arnd@arndb.de>,
	intel-gfx@lists.freedesktop.org, linux-tegra@vger.kernel.org,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	"Tomi Valkeinen" <tomba@kernel.org>,
	linux-kernel@vger.kernel.org, "Liam Mark" <lmark@codeaurora.org>,
	"Tomasz Figa" <tfiga@chromium.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"Christian König" <christian.koenig@amd.com>
Subject: Re: [Intel-gfx] [PATCH v3 6/6] drm/shmem-helper: Switch to reservation lock
Date: Mon, 22 May 2023 16:27:50 +0300	[thread overview]
Message-ID: <abc2a8ab-0969-fbb6-8dec-b15c81df38e4@collabora.com> (raw)
In-Reply-To: <CACvgo52QvmZw5k_9dmBHPB25rTdLZJzVG_vNFr8or+3f5sVO=Q@mail.gmail.com>

On 5/22/23 16:02, Emil Velikov wrote:
> Hi Dmitry,
> 
> Saw v3 fly by, so I had a quick look. Original RB still stands,
> although I noticed a couple of non-blocking nitpicks.
> 
> On Sun, 21 May 2023 at 22:00, Dmitry Osipenko
> <dmitry.osipenko@collabora.com> wrote:
> 
>> -static int drm_gem_shmem_get_pages_locked(struct drm_gem_shmem_object *shmem)
>> +static int drm_gem_shmem_get_pages(struct drm_gem_shmem_object *shmem)
>>  {
> 
> Should this getter have a dma_resv_assert_held(shmem->base.resv); like
> it's put brethren?
> 
> 
>> -void drm_gem_shmem_put_pages(struct drm_gem_shmem_object *shmem)
>> +static int drm_gem_shmem_pin_locked(struct drm_gem_shmem_object *shmem)
>> +{
>> +       int ret;
>> +
>> +       dma_resv_assert_held(shmem->base.resv);
>> +
>> +       ret = drm_gem_shmem_get_pages(shmem);
>> +
>> +       return ret;
> 
> With the assert_held in the getter, it would be less confusing to
> inline this and the unpin_locked functions.
> 
>> +}
>> +
>> +static void drm_gem_shmem_unpin_locked(struct drm_gem_shmem_object *shmem)
>>  {
>> -       mutex_lock(&shmem->pages_lock);
>> -       drm_gem_shmem_put_pages_locked(shmem);
>> -       mutex_unlock(&shmem->pages_lock);
>> +       dma_resv_assert_held(shmem->base.resv);
>> +
>> +       drm_gem_shmem_put_pages(shmem);
> 
> Side note: the putter has an assert_held so the extra one here seems quite odd.
> 
> As said at the top - with or w/o these nitpicks, the original RB still stands.

Good catch. I actually added assert_held to get_pages(), but in a later
patch that is not part of this series.

-- 
Best regards,
Dmitry


  reply	other threads:[~2023-05-22 13:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-21 20:51 [Intel-gfx] [PATCH v3 0/6] Move dma-buf mmap() reservation locking down to exporters Dmitry Osipenko
2023-05-21 20:51 ` [Intel-gfx] [PATCH v3 1/6] media: videobuf2: Don't assert held reservation lock for dma-buf mmapping Dmitry Osipenko
2023-05-21 20:51 ` [Intel-gfx] [PATCH v3 2/6] dma-buf/heaps: " Dmitry Osipenko
2023-05-21 20:51 ` [Intel-gfx] [PATCH v3 3/6] udmabuf: " Dmitry Osipenko
2023-05-21 20:51 ` [Intel-gfx] [PATCH v3 4/6] drm: " Dmitry Osipenko
2023-05-21 20:51 ` [Intel-gfx] [PATCH v3 5/6] dma-buf: Change locking policy for mmap() Dmitry Osipenko
2023-05-21 20:51 ` [Intel-gfx] [PATCH v3 6/6] drm/shmem-helper: Switch to reservation lock Dmitry Osipenko
2023-05-22 13:02   ` Emil Velikov
2023-05-22 13:27     ` Dmitry Osipenko [this message]
2023-05-29 22:05     ` Dmitry Osipenko
2023-05-21 21:26 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for Move dma-buf mmap() reservation locking down to exporters (rev3) Patchwork
2023-05-21 21:40 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-05-21 22:59 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork

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=abc2a8ab-0969-fbb6-8dec-b15c81df38e4@collabora.com \
    --to=dmitry.osipenko@collabora.com \
    --cc=arnd@arndb.de \
    --cc=benjamin.gaignard@collabora.com \
    --cc=christian.koenig@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.l.velikov@gmail.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jstultz@google.com \
    --cc=kernel@collabora.com \
    --cc=kraxel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=lmark@codeaurora.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mchehab@kernel.org \
    --cc=sumit.semwal@linaro.org \
    --cc=tfiga@chromium.org \
    --cc=tomba@kernel.org \
    --cc=tzimmermann@suse.de \
    /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