Depending on contraints around preemption (ie. on what boundaries can the GPU preempt) and priority of other processes using the GPU, the compositor can get starved behind a long-running job.
This can be handled by a hangcheck timer that kills jobs that run too long, but then there is a conflict between legit long running jobs (opencl) and UI responsiveness. This series adds a new sysrq key handler (SysRq-G because SysRq-g was already taken) that kills the current job running on the GPU. So a longer hangcheck timer could be used but the user could still reclaim their "hung" desktop by using SysRq-G to kill the background GPU job. Sending this out as RFC to see what others think of the idea. Possibly the driver implementation should check how long the job has been running to make sure it is only killing a long running job. Possibly we should kill the process behind the long running job, or at least mark the context as unusable to prevent it from spamming more long running jobs. Etc. Rob Clark (2): drm: Add sysrq key to kill current job on GPU drm/msm: Add sysrq_kill handler drivers/gpu/drm/Makefile | 1 + drivers/gpu/drm/drm_dev_sysrq.c | 67 +++++++++++++++++++++++++++++++++ drivers/gpu/drm/drm_drv.c | 3 ++ drivers/gpu/drm/drm_internal.h | 11 ++++++ drivers/gpu/drm/msm/msm_drv.c | 12 ++++++ drivers/gpu/drm/msm/msm_gpu.c | 18 +++++++++ drivers/gpu/drm/msm/msm_gpu.h | 1 + include/drm/drm_device.h | 8 ++++ include/drm/drm_drv.h | 7 ++++ 9 files changed, 128 insertions(+) create mode 100644 drivers/gpu/drm/drm_dev_sysrq.c -- 2.53.0
