Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/8] ULLS for kernel submission of migration jobs
@ 2024-08-12  2:47 Matthew Brost
  2024-08-12  2:47 ` [RFC PATCH 1/8] drm/xe: Add xe_hw_engine_write_ring_tail Matthew Brost
                   ` (16 more replies)
  0 siblings, 17 replies; 22+ messages in thread
From: Matthew Brost @ 2024-08-12  2:47 UTC (permalink / raw)
  To: intel-xe; +Cc: thomas.hellstrom

Ultra low latency for kernel submission of migration jobs.

The basic idea is that faults (CPU or GPU) typically depend on migration
jobs. Faults should be addressed as quickly as possible, but context
switches via GuC on hardware are slow. To avoid context switches,
perform ULLS in the kernel for migration jobs on discrete faulting
devices with an LR VM open.

This is implemented by switching the migration layer to ULLS mode upon
opening an LR VM. In ULLS mode, migration jobs have a preamble and
postamble: the preamble clears the current semaphore value, and the
postamble waits for the next semaphore value. Each job submission sets
the current semaphore in memory, bypassing the GuC. The net effect is
that the migration execution queue never gets switched off the hardware
while an LR VM is open.

There may be concerns regarding power management, as the ring program
continuously runs on a copy engine, and a force wake reference to a copy
engine is held with an LR VM open.

The implementation has been lightly tested but seems to be working.

This approach will likely be put on hold until SVM is operational with
benchmarks, but it is being posted early for feedback and as a public
checkpoint.

Matt

Matthew Brost (8):
  drm/xe: Add xe_hw_engine_write_ring_tail
  drm/xe: Add ULLS support to LRC
  drm/xe: Add ULLS flags for jobs
  drm/xe: Add ULLS migration job support to migration layer
  drm/xe: Add MI_SEMAPHORE_WAIT instruction defs
  drm/xe: Add ULLS migration job support to ring ops
  drm/xe: Add ULLS migration job support to GuC submission
  drm/xe: Enable ULLS migration jobs when opening LR VM

 .../gpu/drm/xe/instructions/xe_mi_commands.h  |   6 +
 drivers/gpu/drm/xe/xe_guc_submit.c            |  26 +++-
 drivers/gpu/drm/xe/xe_hw_engine.c             |  10 ++
 drivers/gpu/drm/xe/xe_hw_engine.h             |   1 +
 drivers/gpu/drm/xe/xe_lrc.c                   |  49 +++++++
 drivers/gpu/drm/xe/xe_lrc.h                   |   3 +
 drivers/gpu/drm/xe/xe_lrc_types.h             |   2 +
 drivers/gpu/drm/xe/xe_migrate.c               | 130 +++++++++++++++++-
 drivers/gpu/drm/xe/xe_migrate.h               |   4 +
 drivers/gpu/drm/xe/xe_ring_ops.c              |  32 +++++
 drivers/gpu/drm/xe/xe_sched_job_types.h       |   3 +
 drivers/gpu/drm/xe/xe_vm.c                    |  10 ++
 12 files changed, 268 insertions(+), 8 deletions(-)

-- 
2.34.1


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

end of thread, other threads:[~2024-09-17 14:40 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-12  2:47 [RFC PATCH 0/8] ULLS for kernel submission of migration jobs Matthew Brost
2024-08-12  2:47 ` [RFC PATCH 1/8] drm/xe: Add xe_hw_engine_write_ring_tail Matthew Brost
2024-08-12  2:47 ` [RFC PATCH 2/8] drm/xe: Add ULLS support to LRC Matthew Brost
2024-08-12  2:47 ` [RFC PATCH 3/8] drm/xe: Add ULLS flags for jobs Matthew Brost
2024-08-12  2:47 ` [RFC PATCH 4/8] drm/xe: Add ULLS migration job support to migration layer Matthew Brost
2024-08-12  2:47 ` [RFC PATCH 5/8] drm/xe: Add MI_SEMAPHORE_WAIT instruction defs Matthew Brost
2024-08-12  2:47 ` [RFC PATCH 6/8] drm/xe: Add ULLS migration job support to ring ops Matthew Brost
2024-08-12  2:47 ` [RFC PATCH 7/8] drm/xe: Add ULLS migration job support to GuC submission Matthew Brost
2024-08-12  2:47 ` [RFC PATCH 8/8] drm/xe: Enable ULLS migration jobs when opening LR VM Matthew Brost
2024-08-12  2:51 ` ✓ CI.Patch_applied: success for ULLS for kernel submission of migration jobs Patchwork
2024-08-12  2:52 ` ✗ CI.checkpatch: warning " Patchwork
2024-08-12  2:53 ` ✓ CI.KUnit: success " Patchwork
2024-08-12  3:05 ` ✓ CI.Build: " Patchwork
2024-08-12  3:07 ` ✓ CI.Hooks: " Patchwork
2024-08-12  3:08 ` ✓ CI.checksparse: " Patchwork
2024-08-12  3:28 ` ✓ CI.BAT: " Patchwork
2024-08-12  4:31 ` ✗ CI.FULL: failure " Patchwork
2024-08-12  8:53 ` [RFC PATCH 0/8] " Thomas Hellström
2024-08-12 17:26   ` Matthew Brost
2024-09-16 13:55     ` Matthew Brost
2024-09-17  6:59       ` Thomas Hellström
2024-09-17 14:39         ` Matthew Brost

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox