From: Rob Clark <robdclark@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
Rob Clark <robdclark@chromium.org>,
linux-kernel@vger.kernel.org (open list),
Sean Paul <sean@poorly.run>
Subject: [PATCH v4 00/15] drm+msm: Shrinker and LRU rework
Date: Tue, 2 Aug 2022 08:51:33 -0700 [thread overview]
Message-ID: <20220802155152.1727594-1-robdclark@gmail.com> (raw)
From: Rob Clark <robdclark@chromium.org>
Unchanged other than small update in 09/15
original description below:
This is mostly motivated by getting drm/msm to pass an i-g-t shrinker
test that I've been working on. In particular the test creates and
cycles between more GEM buffers than what will fit in RAM to force
eviction and re-pin. (There are sub-tests that cover this case both
single threaded and with many child processes in parallel.)
Getting this test to pass necessitated a few improvements:
1. Re-ordering submit path to get rid of __GFP_NORETRY (in the common
case, doing this for syncobjs is still TODO)
2. Decoupling locks needed in the retire path from locks that could
be held while hitting reclaim in the submit path
3. If necessary, allow stalling on active BOs for reclaim.
The latter point is because we pin objects in the synchronous part of
the submit path (before queuing on the drm gpu-scheduler), which means
in the parallel variant of the i-g-t test, we need to be able to block
in the reclaim path until some queued work has completed/retired.
In the process of re-working how drm/msm tracks buffer state in it's
various LRU lists, I refactored out a drm_gem_lru helper which, in
theory, should be usable by other drivers and drm shmem helpers for
implementing LRU tracking and shrinker.
v2: rebase + small fix in 13/13
v3: use lockdep_assert_held in GEM LRU helper, and add a couple patches
at the end to convert MSM from WARN_ON(!is_locked()) to lockdep
asserts
v4: keep drm_gem_move_tail_locked() static until there is a user
Rob Clark (15):
drm/msm: Reorder lock vs submit alloc
drm/msm: Small submit cleanup
drm/msm: Split out idr_lock
drm/msm/gem: Check for active in shrinker path
drm/msm/gem: Rename update_inactive
drm/msm/gem: Rename to pin/unpin_pages
drm/msm/gem: Consolidate pin/unpin paths
drm/msm/gem: Remove active refcnt
drm/gem: Add LRU/shrinker helper
drm/msm/gem: Convert to using drm_gem_lru
drm/msm/gem: Unpin buffers earlier
drm/msm/gem: Consolidate shrinker trace
drm/msm/gem: Evict active GEM objects when necessary
drm/msm/gem: Add msm_gem_assert_locked()
drm/msm/gem: Convert to lockdep assert
drivers/gpu/drm/drm_gem.c | 170 +++++++++++++++++++++++
drivers/gpu/drm/msm/msm_drv.c | 18 ++-
drivers/gpu/drm/msm/msm_drv.h | 70 +++++++---
drivers/gpu/drm/msm/msm_gem.c | 179 +++++++++----------------
drivers/gpu/drm/msm/msm_gem.h | 123 ++---------------
drivers/gpu/drm/msm/msm_gem_prime.c | 4 +-
drivers/gpu/drm/msm/msm_gem_shrinker.c | 164 +++++++++++-----------
drivers/gpu/drm/msm/msm_gem_submit.c | 78 ++++-------
drivers/gpu/drm/msm/msm_gpu.c | 3 -
drivers/gpu/drm/msm/msm_gpu.h | 10 +-
drivers/gpu/drm/msm/msm_gpu_trace.h | 36 +++--
drivers/gpu/drm/msm/msm_submitqueue.c | 1 +
include/drm/drm_gem.h | 55 ++++++++
13 files changed, 491 insertions(+), 420 deletions(-)
--
2.36.1
next reply other threads:[~2022-08-02 15:51 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-02 15:51 Rob Clark [this message]
2022-08-02 15:51 ` [PATCH v4 01/15] drm/msm: Reorder lock vs submit alloc Rob Clark
2022-08-02 15:51 ` [PATCH v4 02/15] drm/msm: Small submit cleanup Rob Clark
2022-08-02 15:51 ` [PATCH v4 03/15] drm/msm: Split out idr_lock Rob Clark
2022-08-02 15:51 ` [PATCH v4 04/15] drm/msm/gem: Check for active in shrinker path Rob Clark
2022-08-02 15:51 ` [PATCH v4 05/15] drm/msm/gem: Rename update_inactive Rob Clark
2022-08-02 15:51 ` [PATCH v4 06/15] drm/msm/gem: Rename to pin/unpin_pages Rob Clark
2022-08-02 15:51 ` [PATCH v4 07/15] drm/msm/gem: Consolidate pin/unpin paths Rob Clark
2022-08-02 15:51 ` [PATCH v4 08/15] drm/msm/gem: Remove active refcnt Rob Clark
2022-08-02 15:51 ` [PATCH v4 09/15] drm/gem: Add LRU/shrinker helper Rob Clark
2022-08-02 15:51 ` [PATCH v4 10/15] drm/msm/gem: Convert to using drm_gem_lru Rob Clark
2022-08-02 15:51 ` [PATCH v4 11/15] drm/msm/gem: Unpin buffers earlier Rob Clark
2022-08-02 15:51 ` [PATCH v4 12/15] drm/msm/gem: Consolidate shrinker trace Rob Clark
2022-08-02 15:51 ` [PATCH v4 13/15] drm/msm/gem: Evict active GEM objects when necessary Rob Clark
2022-08-02 15:51 ` [PATCH v4 14/15] drm/msm/gem: Add msm_gem_assert_locked() Rob Clark
2022-08-02 15:51 ` [PATCH v4 15/15] drm/msm/gem: Convert to lockdep assert Rob Clark
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=20220802155152.1727594-1-robdclark@gmail.com \
--to=robdclark@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robdclark@chromium.org \
--cc=sean@poorly.run \
/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