linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/13] drm+msm: Shrinker and LRU rework
@ 2022-07-19 17:18 Rob Clark
  2022-07-19 17:18 ` [PATCH v2 01/13] drm/msm: Reorder lock vs submit alloc Rob Clark
                   ` (12 more replies)
  0 siblings, 13 replies; 16+ messages in thread
From: Rob Clark @ 2022-07-19 17:18 UTC (permalink / raw)
  To: dri-devel; +Cc: freedreno, linux-arm-msm, Rob Clark, open list, Sean Paul

From: Rob Clark <robdclark@chromium.org>

Mostly a resend with a small fix in the last patch (and a couple early
patches drop out when rebasing).

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.

Rob Clark (13):
  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

 drivers/gpu/drm/drm_gem.c              | 183 +++++++++++++++++++++++++
 drivers/gpu/drm/msm/msm_drv.c          |  18 ++-
 drivers/gpu/drm/msm/msm_drv.h          |  70 +++++++---
 drivers/gpu/drm/msm/msm_gem.c          | 149 +++++++-------------
 drivers/gpu/drm/msm/msm_gem.h          | 112 +--------------
 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                  |  56 ++++++++
 13 files changed, 483 insertions(+), 401 deletions(-)

-- 
2.36.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2022-07-20 17:57 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-19 17:18 [PATCH v2 00/13] drm+msm: Shrinker and LRU rework Rob Clark
2022-07-19 17:18 ` [PATCH v2 01/13] drm/msm: Reorder lock vs submit alloc Rob Clark
2022-07-19 17:18 ` [PATCH v2 02/13] drm/msm: Small submit cleanup Rob Clark
2022-07-19 17:18 ` [PATCH v2 03/13] drm/msm: Split out idr_lock Rob Clark
2022-07-19 17:18 ` [PATCH v2 04/13] drm/msm/gem: Check for active in shrinker path Rob Clark
2022-07-19 17:18 ` [PATCH v2 05/13] drm/msm/gem: Rename update_inactive Rob Clark
2022-07-19 17:18 ` [PATCH v2 06/13] drm/msm/gem: Rename to pin/unpin_pages Rob Clark
2022-07-19 17:18 ` [PATCH v2 07/13] drm/msm/gem: Consolidate pin/unpin paths Rob Clark
2022-07-19 17:18 ` [PATCH v2 08/13] drm/msm/gem: Remove active refcnt Rob Clark
2022-07-19 17:18 ` [PATCH v2 09/13] drm/gem: Add LRU/shrinker helper Rob Clark
2022-07-19 18:56   ` Dmitry Osipenko
2022-07-20 17:57     ` Rob Clark
2022-07-19 17:18 ` [PATCH v2 10/13] drm/msm/gem: Convert to using drm_gem_lru Rob Clark
2022-07-19 17:18 ` [PATCH v2 11/13] drm/msm/gem: Unpin buffers earlier Rob Clark
2022-07-19 17:18 ` [PATCH v2 12/13] drm/msm/gem: Consolidate shrinker trace Rob Clark
2022-07-19 17:18 ` [PATCH v2 13/13] drm/msm/gem: Evict active GEM objects when necessary Rob Clark

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).