]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/xe: Wait on killed exec queues
authorLucas De Marchi <lucas.demarchi@intel.com>
Fri, 8 Nov 2024 05:33:16 +0000 (21:33 -0800)
committerLucas De Marchi <lucas.demarchi@intel.com>
Wed, 13 Nov 2024 17:10:57 +0000 (09:10 -0800)
commit0fd4380c050d71334eb61067f3228a5d57172a45
treebb1f70f395e7812f2e818b10393a841c0962b558
parentc8b3c6db941299d7cc31bd9befed3518fdebaf68
drm/xe: Wait on killed exec queues

When an exec queue is killed it triggers an async process of asking the
GuC to schedule the context out. The timestamp in the context image is
only updated when this process completes. In case a userspace process
kills an exec and tries to read the timestamp, it may not get an updated
runtime.

Add synchronization between the process reading the fdinfo and the exec
queue being killed. After reading all the timestamps, wait on exec
queues in the process of being killed. When that wait is over,
xe_exec_queue_fini() was already called and updated the timestamps.

v2: Do not update pending_removal before validating user args
    (Matthew Auld)
v3: Move wait on pending to be done before getting any timestamp
    so it's more likely for the gpu and exec queue timestamps to
    be closer together

Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/2667
Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241108053318.3483678-2-lucas.demarchi@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
drivers/gpu/drm/xe/xe_device_types.h
drivers/gpu/drm/xe/xe_drm_client.c
drivers/gpu/drm/xe/xe_exec_queue.c