Skip to content

Commit c8ea2c3

Browse files
mbrost05Thomas Hellström
authored andcommitted
drm/xe: Only use reserved BCS instances for usm migrate exec queue
The GuC context scheduling queue is 2 entires deep, thus it is possible for a migration job to be stuck behind a fault if migration exec queue shares engines with user jobs. This can deadlock as the migrate exec queue is required to service page faults. Avoid deadlock by only using reserved BCS instances for usm migrate exec queue. Fixes: a043fba ("drm/xe/pvc: Use fast copy engines as migrate engine on PVC") Cc: Matt Roper <[email protected]> Cc: Niranjana Vishwanathapura <[email protected]> Signed-off-by: Matthew Brost <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Brian Welty <[email protected]> (cherry picked from commit 04f4a70) Signed-off-by: Thomas Hellström <[email protected]>
1 parent 77b79df commit c8ea2c3

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

drivers/gpu/drm/xe/xe_migrate.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
#include "xe_sync.h"
3535
#include "xe_trace.h"
3636
#include "xe_vm.h"
37-
#include "xe_wa.h"
3837

3938
/**
4039
* struct xe_migrate - migrate context.
@@ -300,10 +299,6 @@ static int xe_migrate_prepare_vm(struct xe_tile *tile, struct xe_migrate *m,
300299
}
301300

302301
/*
303-
* Due to workaround 16017236439, odd instance hardware copy engines are
304-
* faster than even instance ones.
305-
* This function returns the mask involving all fast copy engines and the
306-
* reserved copy engine to be used as logical mask for migrate engine.
307302
* Including the reserved copy engine is required to avoid deadlocks due to
308303
* migrate jobs servicing the faults gets stuck behind the job that faulted.
309304
*/
@@ -317,8 +312,7 @@ static u32 xe_migrate_usm_logical_mask(struct xe_gt *gt)
317312
if (hwe->class != XE_ENGINE_CLASS_COPY)
318313
continue;
319314

320-
if (!XE_WA(gt, 16017236439) ||
321-
xe_gt_is_usm_hwe(gt, hwe) || hwe->instance & 1)
315+
if (xe_gt_is_usm_hwe(gt, hwe))
322316
logical_mask |= BIT(hwe->logical_instance);
323317
}
324318

@@ -369,6 +363,10 @@ struct xe_migrate *xe_migrate_init(struct xe_tile *tile)
369363
if (!hwe || !logical_mask)
370364
return ERR_PTR(-EINVAL);
371365

366+
/*
367+
* XXX: Currently only reserving 1 (likely slow) BCS instance on
368+
* PVC, may want to revisit if performance is needed.
369+
*/
372370
m->q = xe_exec_queue_create(xe, vm, logical_mask, 1, hwe,
373371
EXEC_QUEUE_FLAG_KERNEL |
374372
EXEC_QUEUE_FLAG_PERMANENT |

0 commit comments

Comments
 (0)