Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] drm/xe/forcewake: add delayed release for engine-cycle queries
@ 2026-10-17  3:18 Zongyao Bai
  2026-10-17  3:18 ` [PATCH 1/3] drm/xe/forcewake: add delayed release with hysteresis Zongyao Bai
                   ` (8 more replies)
  0 siblings, 9 replies; 17+ messages in thread
From: Zongyao Bai @ 2026-10-17  3:18 UTC (permalink / raw)
  To: intel-xe; +Cc: rodrigo.vivi, Zongyao Bai

Engine-cycle queries are issued repeatedly by profilers such as VTune
and PTI to correlate CPU and GPU timestamps, for example through Level
Zero zeDeviceGetGlobalTimestamps(). Each query wakes the engine
forcewake domain and puts it to sleep again, and waiting for both
acknowledgments dominates the query latency.

This series adds an opt-in delayed release to forcewake. After the
final reference to a domain is dropped with xe_force_wake_put_delay(),
the domain stays awake for a short hold time, and a get within that
time reuses it without another wake request or ACK wait. The domain is
put to sleep from a delayed work in process context, so the sleep ACK
is waited for as in a regular put. The work sleeps only domains whose
hold time expired and that are still unreferenced, and requeues itself
for the rest. The hold time is a couple of jiffies.

Delayed release must not outlive the device being powered off, reset
or removed. System and runtime suspend flush it: the pending work is
canceled and the held domains are put to sleep, while delayed release
stays available after resume. GT shutdown, device removal and
post-registration probe failure stop it: the work is disabled for good,
and a later delayed put puts the domain to sleep right away.

Only engine-cycle queries opt in. All other forcewake users keep
releasing immediately.

Zongyao Bai (3):
  drm/xe/forcewake: add delayed release with hysteresis
  drm/xe/forcewake: flush delayed release at power and teardown
    boundaries
  drm/xe/query: use delayed forcewake release for engine-cycle queries

 drivers/gpu/drm/xe/xe_device.c           |  11 ++
 drivers/gpu/drm/xe/xe_force_wake.c       | 228 ++++++++++++++++++++---
 drivers/gpu/drm/xe/xe_force_wake.h       |  39 +++-
 drivers/gpu/drm/xe/xe_force_wake_types.h |  42 +++++
 drivers/gpu/drm/xe/xe_gt.c               |  15 +-
 drivers/gpu/drm/xe/xe_query.c            |   2 +-
 6 files changed, 305 insertions(+), 32 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2026-11-10 22:34 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-17  3:18 [PATCH 0/3] drm/xe/forcewake: add delayed release for engine-cycle queries Zongyao Bai
2026-10-17  3:18 ` [PATCH 1/3] drm/xe/forcewake: add delayed release with hysteresis Zongyao Bai
2026-11-09 20:55   ` Rodrigo Vivi
2026-11-10  1:00     ` Bai, Zongyao
2026-10-17  3:18 ` [PATCH 2/3] drm/xe/forcewake: flush delayed release at power and teardown boundaries Zongyao Bai
2026-10-17  3:18 ` [PATCH 3/3] drm/xe/query: use delayed forcewake release for engine-cycle queries Zongyao Bai
2026-10-17  3:25 ` ✗ CI.checkpatch: warning for drm/xe/forcewake: add delayed " Patchwork
2026-10-17  3:27 ` ✓ CI.KUnit: success " Patchwork
2026-10-17  3:27 ` [PATCH 0/3] " Simon Richter
2026-10-17  4:07 ` ✓ Xe.CI.BAT: success for " Patchwork
2026-10-17  5:48 ` ✓ Xe.CI.FULL: " Patchwork
2026-11-10 22:05 ` [PATCH v2 0/3] " Zongyao Bai
2026-11-10 22:05   ` [PATCH v2 1/3] drm/xe/forcewake: add delayed release with hysteresis Zongyao Bai
2026-11-10 22:34     ` sashiko-bot
2026-11-10 22:05   ` [PATCH v2 2/3] drm/xe/forcewake: flush delayed release at power and teardown boundaries Zongyao Bai
2026-11-10 22:26     ` sashiko-bot
2026-11-10 22:05   ` [PATCH v2 3/3] drm/xe/query: use delayed forcewake release for engine-cycle queries Zongyao Bai

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