mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Natalie Vock <nat@pixelcluster.dev>
To: "Felix Kuehling" <Felix.Kuehling@amd.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"Timur Kristóf" <timur.kristof@gmail.com>
Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	 linux-kernel@vger.kernel.org,
	Natalie Vock <nat@pixelcluster.dev>
Subject: [PATCH v2 00/10] drm/amdgpu: Rework VM update ops for batching and explicit sync
Date: Tue, 17 Nov 2026 13:50:06 +0100	[thread overview]
Message-ID: <20261117-prt-explicit-sync-v2-0-bb3851cb6a0c@pixelcluster.dev> (raw)

Hi,

this is v2 of my attempt at improving sparse binding perf.

The motivator is that many games have come to heavily use sparse
bindings, and they often rely on being able to overlap frame work on
gfx/compute queues with sparse binding work on sdma. If PRT mappings
are synced to every other submissions like they are right now, heavy
sparse binding load can stall the gfx/compute submissions for quite a
long while, leading to very noticeable stutters and hitches.

Another problem is that each sparse binding update requires a separate
ioctl, so the CPU will also spend significant time constantly switching
between user and kernel mode to execute the binding changes one at a
time.

To remedy this, this patchset introduces a "VM update context" structure.
This context encapsulates some state that is carried around different VM
update functions, in patch 1 this is the mappings that were freed along
the way. amdgpu_vm_clear_freed then only clears the mappings that were
actually freed in the update operation, which is a requirement for being
able to explicitly sync that unmap.

In later patches, the update context is expanded to hold a set of
pending mapping changes, so that a future ioctl that changes many
mappings at a time has a place to keep pending changes while every
change is validated, before applying everything atomically if things
look okay.

Best,
Natalie

Signed-off-by: Natalie Vock <nat@pixelcluster.dev>
---
Changes in v2:
- Added pending change structures to update context in order to batch changes
- Link to v1: https://patch.msgid.link/20260529-prt-explicit-sync-v1-0-9f1c60955cab@gmx.de

---
Natalie Vock (10):
      drm/amdgpu: Remove unused parameter from amdgpu_vm_pte_fragment
      drm/amdgpu: Add and use vm_update_ctx struct
      drm/amdgpu: Make VM maps pending per update context
      drm/amdgpu: Make removed/cleared mappings pending per update context
      drm/amdgpu: Track dirty bo_va structures in update ctx
      drm/amdgpu: Add function to roll back a VM update ctx
      drm/amdgpu: Move some VA op validation to a helper
      drm/amdgpu: Only reject conflicting mappings if they are not cleared
      drm/amdgpu: Add new AMDGPU_GEM_VA2 ioctl
      drm/amdgpu: Bump minor version

 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c |  33 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c           |  31 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c          |  21 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c      |   2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c          |   6 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c          | 477 ++++++++++++++--
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.h          |   2 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.h       |   3 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_seq64.c        |   9 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c       |   2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c        |  10 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c           | 660 +++++++++++++++--------
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h           | 100 +++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c        |   8 +-
 include/uapi/drm/amdgpu_drm.h                    |  46 ++
 15 files changed, 1099 insertions(+), 311 deletions(-)
---
base-commit: 65b7b0d2cf8c3cba99d599493ac96f3ab32c0a06
change-id: 20260529-prt-explicit-sync-3d74b9dd420c

Best regards,
--  
Natalie Vock <nat@pixelcluster.dev>


             reply	other threads:[~2026-11-17 12:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17 12:50 Natalie Vock [this message]
2026-11-17 12:50 ` [PATCH v2 01/10] drm/amdgpu: Remove unused parameter from amdgpu_vm_pte_fragment Natalie Vock
2026-11-17 12:50 ` [PATCH v2 02/10] drm/amdgpu: Add and use vm_update_ctx struct Natalie Vock
2026-11-17 12:50 ` [PATCH v2 03/10] drm/amdgpu: Make VM maps pending per update context Natalie Vock
2026-11-17 12:50 ` [PATCH v2 04/10] drm/amdgpu: Make removed/cleared mappings " Natalie Vock
2026-11-17 12:50 ` [PATCH v2 05/10] drm/amdgpu: Track dirty bo_va structures in update ctx Natalie Vock
2026-11-17 12:50 ` [PATCH v2 06/10] drm/amdgpu: Add function to roll back a VM " Natalie Vock
2026-11-17 12:50 ` [PATCH v2 07/10] drm/amdgpu: Move some VA op validation to a helper Natalie Vock
2026-11-17 12:50 ` [PATCH v2 08/10] drm/amdgpu: Only reject conflicting mappings if they are not cleared Natalie Vock
2026-11-17 12:50 ` [PATCH v2 09/10] drm/amdgpu: Add new AMDGPU_GEM_VA2 ioctl Natalie Vock
2026-11-17 12:50 ` [PATCH v2 10/10] drm/amdgpu: Bump minor version Natalie Vock

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=20261117-prt-explicit-sync-v2-0-bb3851cb6a0c@pixelcluster.dev \
    --to=nat@pixelcluster.dev \
    --cc=Felix.Kuehling@amd.com \
    --cc=airlied@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=timur.kristof@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®