From: Boris Brezillon <boris.brezillon@collabora.com>
To: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Cc: Emil Velikov <emil.l.velikov@gmail.com>,
dri-devel@lists.freedesktop.org,
Steven Price <steven.price@arm.com>,
Thomas Zimmermann <tzimmermann@suse.de>
Subject: Re: [PATCH 1/5] drm/panfrost: Stop using drm_gem_shmem_put_pages()
Date: Mon, 26 Jun 2023 18:21:12 +0200 [thread overview]
Message-ID: <20230626182112.07fa4a1f@collabora.com> (raw)
In-Reply-To: <393007f6-5a93-d541-6e22-c76f7f309bdb@collabora.com>
On Mon, 26 Jun 2023 19:06:55 +0300
Dmitry Osipenko <dmitry.osipenko@collabora.com> wrote:
> On 6/26/23 18:43, Boris Brezillon wrote:
> > On Mon, 26 Jun 2023 16:20:53 +0300
> > Dmitry Osipenko <dmitry.osipenko@collabora.com> wrote:
> >
> >> On 6/26/23 15:02, Boris Brezillon wrote:
> >>> -err_pages:
> >>> - drm_gem_shmem_put_pages(&bo->base);
> >>> err_unlock:
> >>> dma_resv_unlock(obj->resv);
> >>> +
> >>> + if (ret && pinned)
> >>> + drm_gem_shmem_unpin(&bo->base);
> >>
> >> The drm_gem_shmem_unpin() was supposed to be used only in conjunction
> >> with drm_gem_shmem_pin(). I've a pending patch to enable the pin/unpin
> >> refcounting needed by drm-shmem shrinker, it will prohibit invocation of
> >> unpin without a previous pin.
> >>
> >> I'm wondering whether it will be okay to simply remove
> >> drm_gem_shmem_put_pages() from the Panfrost code, letting pages to be
> >> kept allocated in a error case. They will be freed once BO is destroyed.
> >>
> >
> > Okay, so after looking at your shmem-shrinker series, I confirm we need
> > to take a pin ref here (hard-pin), otherwise the buffer might be
> > evicted before the GPU is done, especially after you drop gpu_usecount
> > and use only pin_count to check whether a GEM object can be evicted or
> > not.
>
> See the drm_gem_evict() [1], it checks whether GEM is busy, preventing
> BO eviction while it is in-use by GPU. Note that in case of Panfrost,
> shrinker isn't enabled for growable BOs.
Okay, we should be good then, sorry for the confusion.
next prev parent reply other threads:[~2023-06-26 16:21 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-26 12:02 [PATCH 0/5] drm/shmem-helper: Follow-up on 'Switch to reservation lock' Boris Brezillon
2023-06-26 12:02 ` [PATCH 1/5] drm/panfrost: Stop using drm_gem_shmem_put_pages() Boris Brezillon
2023-06-26 13:20 ` Dmitry Osipenko
2023-06-26 13:38 ` Boris Brezillon
2023-06-26 15:43 ` Boris Brezillon
2023-06-26 16:06 ` Dmitry Osipenko
2023-06-26 16:21 ` Boris Brezillon [this message]
2023-06-26 12:02 ` [PATCH 2/5] drm/shmem-helper: Stop exposing drm_gem_shmem_put_pages() Boris Brezillon
2023-06-26 12:02 ` [PATCH 3/5] drm/shmem-helper: Inline drm_gem_shmem_{get,put}_pages() Boris Brezillon
2023-06-26 15:34 ` Boris Brezillon
2023-06-26 12:02 ` [PATCH 4/5] drm/shmem-helper: Make dma_resv_assert_held() unconditional in drm_gem_shmem_v[un]map() Boris Brezillon
2023-06-26 12:02 ` [PATCH 5/5] drm/shmem-helper: Clarify drm_gem_shmem_v[un]map() usage Boris Brezillon
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=20230626182112.07fa4a1f@collabora.com \
--to=boris.brezillon@collabora.com \
--cc=dmitry.osipenko@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=emil.l.velikov@gmail.com \
--cc=steven.price@arm.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.