Skip to content

CPU binds and ULLS on migration queue

Matthew Brost intel-xe 8 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v8 Latest24 patches 1 replyIn review
  2. v724 patches 18 repliesSuperseded
  3. v624 patches 32 repliesSuperseded
Earlier versions · 5
VersionPostedPatchesRepliesStatus
v525 patches3 repliesSuperseded
v425 patches8 repliesSuperseded
v325 patches33 repliesSuperseded
v215 patches1 replySuperseded
v115 patches2 repliesSuperseded

Changes in v8 from the cover letter

- s/%d/%u
- One last CI / Sashiko run before merging

Patches in v8 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/24drm/xe: reference VM from PT BOsdrivers/gpu/drm/xe/xe_bo.c+2 -20 replies
2/24drm/xe: Drop struct xe_migrate_pt_update argument from populate/clear vfunsdrivers/gpu/drm/xe/xe_migrate.c drivers/gpu/drm/xe/xe_migrate.h drivers/gpu/drm/xe/xe_pt.c+15 -180 replies
3/24drm/xe: Add xe_migrate_update_pgtables_cpu_execute helperdrivers/gpu/drm/xe/xe_migrate.c+33 -230 replies
4/24drm/xe: Decouple exec queue idle check from LRCdrivers/gpu/drm/xe/xe_exec_queue.c+1 -140 replies
5/24drm/xe: Add job count to GuC exec queue snapshotdrivers/gpu/drm/xe/xe_guc_submit.c drivers/gpu/drm/xe/xe_guc_submit_types.h+4 -00 replies
6/24drm/xe: Update xe_bo_put_deferred arguments to include writeback flagdrivers/gpu/drm/xe/xe_bo.h drivers/gpu/drm/xe/xe_drm_client.c drivers/gpu/drm/xe/xe_pt.c+10 -40 replies
7/24drm/xe: Update scheduler job layer to support PT jobsdrivers/gpu/drm/xe/xe_sched_job.c drivers/gpu/drm/xe/xe_sched_job_types.h drivers/gpu/drm/xe/xe_trace.h+92 -360 replies
8/24drm/xe: Add helpers to access PT opsdrivers/gpu/drm/xe/xe_pt.c+45 -200 replies
9/24drm/xe: Add struct xe_pt_job_opsdrivers/gpu/drm/xe/xe_migrate.c drivers/gpu/drm/xe/xe_pt.c drivers/gpu/drm/xe/xe_pt.h +2 more+142 -350 replies
10/24drm/xe: Update GuC submission backend to run PT jobsdrivers/gpu/drm/xe/xe_guc_submit.c drivers/gpu/drm/xe/xe_migrate.c drivers/gpu/drm/xe/xe_migrate.h+51 -71 reply
11/24drm/xe: Store level in struct xe_vm_pgtable_updatedrivers/gpu/drm/xe/xe_pt.c drivers/gpu/drm/xe/xe_pt_types.h+9 -20 replies
12/24drm/xe: Don't use migrate exec queue for page fault bindsdrivers/gpu/drm/xe/xe_migrate.c drivers/gpu/drm/xe/xe_migrate.h drivers/gpu/drm/xe/xe_vm.c+55 -100 replies
13/24drm/xe: Enable CPU binds for jobsdrivers/gpu/drm/xe/xe_bo_types.h drivers/gpu/drm/xe/xe_migrate.c drivers/gpu/drm/xe/xe_pt.c+17 -2350 replies
14/24drm/xe: Remove unused arguments from xe_migrate_pt_update_opsdrivers/gpu/drm/xe/xe_migrate.c drivers/gpu/drm/xe/xe_migrate.h drivers/gpu/drm/xe/xe_pt.c+15 -380 replies
15/24drm/xe: Make bind queues operate cross-tiledrivers/gpu/drm/xe/xe_exec_queue.c drivers/gpu/drm/xe/xe_exec_queue.h drivers/gpu/drm/xe/xe_exec_queue_types.h +6 more+124 -1770 replies
16/24drm/xe: Add CPU bind layerdrivers/gpu/drm/xe/Makefile drivers/gpu/drm/xe/xe_cpu_bind.c drivers/gpu/drm/xe/xe_cpu_bind.h +15 more+808 -7610 replies
17/24drm/xe: Add device flag to enable PT mirroring across tilesdrivers/gpu/drm/xe/xe_device_types.h drivers/gpu/drm/xe/xe_migrate.c drivers/gpu/drm/xe/xe_pci.c +4 more+79 -90 replies
18/24drm/xe: Add ULLS support to LRCdrivers/gpu/drm/xe/xe_lrc.c drivers/gpu/drm/xe/xe_lrc.h drivers/gpu/drm/xe/xe_lrc_types.h+81 -00 replies
19/24drm/xe: Add ULLS migration job support to migration layerdrivers/gpu/drm/xe/xe_exec_queue.c drivers/gpu/drm/xe/xe_exec_queue.h drivers/gpu/drm/xe/xe_migrate.c +5 more+265 -210 replies
20/24drm/xe: Add ULLS migration job support to ring opsdrivers/gpu/drm/xe/xe_ring_ops.c drivers/gpu/drm/xe/xe_ring_ops_types.h+99 -00 replies
21/24drm/xe: Add ULLS migration job support to GuC submissiondrivers/gpu/drm/xe/xe_guc_submit.c+13 -40 replies
22/24drm/xe: Enter ULLS for migration jobs upon page fault or SVM prefetchdrivers/gpu/drm/xe/xe_pagefault.c drivers/gpu/drm/xe/xe_vm.c+6 -10 replies
23/24drm/xe: add migrate ULLS period configfs attributedrivers/gpu/drm/xe/xe_configfs.c drivers/gpu/drm/xe/xe_configfs.h drivers/gpu/drm/xe/xe_migrate.c+82 -60 replies
24/24drm/xe: Document ULLS for migration jobsDocumentation/gpu/xe/xe_migrate.rst drivers/gpu/drm/xe/xe_migrate.c+152 -00 replies

Reviews trailers per patch

All 24 patches have a Reviewed-by or Acked-by.

PatchMaarten LankhorstFrancois DugastStuart SummersHimal Prasad GhimirayShuicheng Lin
1/24R-b R-b
2/24R-b R-b
3/24R-b R-b
4/24R-b R-b
5/24R-b R-b
6/24R-b R-b
7/24R-b R-b
8/24R-b R-b
9/24R-b R-b
10/24R-b R-b
11/24R-b R-b R-b
12/24R-b R-b
13/24R-b R-b
14/24R-b R-b
15/24R-b R-b
16/24R-b R-b R-b
17/24R-b R-b
18/24R-b R-b
19/24R-b
20/24R-b R-b R-b
21/24R-b R-b R-b
22/24R-b R-b R-b
23/24R-b
24/24R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v8 thread

Cover letter [PATCH v8 00/24] CPU binds and ULLS on migration queue

We now have data demonstrating the need for CPU binds and ULLS on the migration queue, based on results generated from [1].

On BMG, measurements show that when the GPU is continuously processing faults, copy jobs run approximately 30–40µs faster (depending on the test case) with ULLS compared to traditional GuC submission with SLPC enabled on the migration queue. Startup from a cold GPU shows an even larger speedup. Given the critical nature of fault performance, ULLS appears to be a worthwhile feature.

In addition to driver telemetry, UMD compute benchmarks consistently show multiple GB/s improvement in pagefault benchmarks with ULLS enabled.

ULLS will consume more power (not yet measured) due to a continuously running batch on the paging engine. However, compute UMDs already do this on engines exposed to users, so this seems like a worthwhile tradeoff. To mitigate power concerns, ULLS will exit after a period of time in which no faults have been processed.

CPU binds are required for ULLS to function, as the migration queue needs exclusive access to the paging hardware engine. Thus, CPU binds are included here.

Beyond being a requirement for ULLS, CPU binds should also reduce VM-bind latency, provide clearer multi-tile and TLB-invalidation layering, reduce pressure on GuC during fault storms as it is bypassed, and decouple kernel binds from unrelated copy/clear jobs—especially beneficial when faults are serviced in parallel. In a parallel-faulting test case, average bind time was reduced by approximately 15µs. In the worst case, 2MB copy time (~60–140µs) × (number of pagefault threads −
1) of latency would otherwise be added to a single fault. Reducing this latency increases overall throughput of the fault handler.

This series can be merged in phases:

Phase 1: CPU binds (patches 1–13)
Phase 2: CPU-bind components and multi-tile relayers (patches 14–17) Phase 3: ULLS on the migration execution queue (patches 18–24)

v2:
- Use delayed worker to exit ULLS mode in an effort to save on power
- Various other cleanups
v3:
- CPU bind component, multi-tile relayer
- Split CPU bind patches in many small patches
v4:
- Rebase, address feedback, add ULLS doc patch
v5:
- Address Sashiko feedback, fix checkpatch issues
v6:
- Reworked ULLS to drop KMD MMIO ring tail write, move this to ring instruction(s)
- Several other small cleanups based on Sashiko feedback
v7:
- Drop XE_BO_FLAG_PUT_VM_ASYNC in favor PT BOs holding a VM ref
- configfs to ULLS enable and period
- Migrate ULLS implementation style cleanups
- Address various feedback
v8:
- s/%d/%u
- One last CI / Sashiko run before merging

Matt

[1] https://patchwork.freedesktop.org/series/149811/

Matthew Brost (24):
drm/xe: reference VM from PT BOs
drm/xe: Drop struct xe_migrate_pt_update argument from populate/clear
vfuns
drm/xe: Add xe_migrate_update_pgtables_cpu_execute helper drm/xe: Decouple exec queue idle check from LRC
drm/xe: Add job count to GuC exec queue snapshot
drm/xe: Update xe_bo_put_deferred arguments to include writeback flag drm/xe: Update scheduler job layer to support PT jobs drm/xe: Add helpers to access PT ops
drm/xe: Add struct xe_pt_job_ops
drm/xe: Update GuC submission backend to run PT jobs drm/xe: Store level in struct xe_vm_pgtable_update
drm/xe: Don't use migrate exec queue for page fault binds drm/xe: Enable CPU binds for jobs
drm/xe: Remove unused arguments from xe_migrate_pt_update_ops drm/xe: Make bind queues operate cross-tile
drm/xe: Add CPU bind layer
drm/xe: Add device flag to enable PT mirroring across tiles drm/xe: Add ULLS support to LRC
drm/xe: Add ULLS migration job support to migration layer drm/xe: Add ULLS migration job support to ring ops
drm/xe: Add ULLS migration job support to GuC submission drm/xe: Enter ULLS for migration jobs upon page fault or SVM prefetch drm/xe: add migrate ULLS period configfs attribute
drm/xe: Document ULLS for migration jobs

 Documentation/gpu/xe/xe_migrate.rst      |   3 +
 drivers/gpu/drm/xe/Makefile              |   1 +
 drivers/gpu/drm/xe/xe_bo.c               |   4 +-
 drivers/gpu/drm/xe/xe_bo.h               |  10 +-
 drivers/gpu/drm/xe/xe_bo_types.h         |   2 -
 drivers/gpu/drm/xe/xe_configfs.c         |  67 ++
 drivers/gpu/drm/xe/xe_configfs.h         |   2 +
 drivers/gpu/drm/xe/xe_cpu_bind.c         | 296 +++++++++
 drivers/gpu/drm/xe/xe_cpu_bind.h         | 111 ++++
 drivers/gpu/drm/xe/xe_device.c           |   5 +
 drivers/gpu/drm/xe/xe_device_types.h     |   6 +
 drivers/gpu/drm/xe/xe_drm_client.c       |   2 +-
 drivers/gpu/drm/xe/xe_exec_queue.c       | 163 ++---
 drivers/gpu/drm/xe/xe_exec_queue.h       |  16 +-
 drivers/gpu/drm/xe/xe_exec_queue_types.h |  20 +-
 drivers/gpu/drm/xe/xe_guc_submit.c       |  76 ++-
 drivers/gpu/drm/xe/xe_guc_submit_types.h |   2 +
 drivers/gpu/drm/xe/xe_lrc.c              |  73 +++
 drivers/gpu/drm/xe/xe_lrc.h              |   4 +
 drivers/gpu/drm/xe/xe_lrc_types.h        |   4 +
 drivers/gpu/drm/xe/xe_migrate.c          | 769 ++++++++++------------
 drivers/gpu/drm/xe/xe_migrate.h          |  95 +--
 drivers/gpu/drm/xe/xe_pagefault.c        |   3 +
 drivers/gpu/drm/xe/xe_pci.c              |   2 +
 drivers/gpu/drm/xe/xe_pci_types.h        |   3 +-
 drivers/gpu/drm/xe/xe_pt.c               | 781 ++++++++++++++---------
 drivers/gpu/drm/xe/xe_pt.h               |  12 +-
 drivers/gpu/drm/xe/xe_pt_types.h         |  49 +-
 drivers/gpu/drm/xe/xe_ring_ops.c         |  75 +++
 drivers/gpu/drm/xe/xe_ring_ops_types.h   |  24 +
 drivers/gpu/drm/xe/xe_sched_job.c        | 103 ++-
 drivers/gpu/drm/xe/xe_sched_job.h        |  56 ++
 drivers/gpu/drm/xe/xe_sched_job_types.h  |  49 +-
 drivers/gpu/drm/xe/xe_sync.c             |  20 +-
 drivers/gpu/drm/xe/xe_tlb_inval_job.c    |  28 +-
 drivers/gpu/drm/xe/xe_tlb_inval_job.h    |   4 +-
 drivers/gpu/drm/xe/xe_trace.h            |   2 +-
 drivers/gpu/drm/xe/xe_vm.c               | 242 +++----
 drivers/gpu/drm/xe/xe_vm.h               |   3 +
 drivers/gpu/drm/xe/xe_vm_types.h         |  12 +-
 40 files changed, 1988 insertions(+), 1211 deletions(-)
 create mode 100644 drivers/gpu/drm/xe/xe_cpu_bind.c
 create mode 100644 drivers/gpu/drm/xe/xe_cpu_bind.h
Signature · 1 line
2.34.1