Skip to content

drm/xe: serialize store_data and user_interrupt for ufence wait

[email protected] intel-xe 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1drm/xe: serialize store_data and user_interrupt for ufence waitdrivers/gpu/drm/xe/instructions/xe_mi_commands.h drivers/gpu/drm/xe/xe_ring_ops.c+25 -05 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/1] drm/xe: serialize store_data and user_interrupt for ufence wait

From: Fei Yang <[email protected]>

Quote BSpec, MI_STORE_DATA_IMM "simply initiates the write operation with command execution proceeding normally. Although the write operation is guaranteed to complete eventually, there is no mechanism to synchronize command execution with the completion (or even initiation) of these operations."
The KMD currently emit MI_STORE_DATA_IMM and MI_USER_INTERRUPT consecutively to implement user fence. However, according to the BSpec, the data write operation is not guaranteed to be completed when triggering the interrupt, that would cause the xe_wait_user_fence_ioctl to wait until the full user specified timeout is reached before checking the fence value again. Great performance degradation has been observed in IGT xe_exec_fault_mode test cases due to this unnecessary wait. The worst case is that if user set the timeout to MAX_INT32, the wait could end up being a hang until some other random program triggers a user interrupt to wake it up.
A semaphore wait is added right after the data write to avoid the unexpected wait.

Fei Yang (1):
drm/xe: serialize store_data and user_interrupt for ufence wait

 drivers/gpu/drm/xe/instructions/xe_mi_commands.h | 11 +++++++++++
 drivers/gpu/drm/xe/xe_ring_ops.c                 | 14 ++++++++++++++
 2 files changed, 25 insertions(+)
Signature · 1 line
2.43.0