Skip to content

RFC drm: Add sysrq handler to kill GPU

Rob Clark dri-devel linux-arm-msm lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2drm: Add sysrq key to kill current job on GPUdrivers/gpu/drm/Makefile drivers/gpu/drm/drm_dev_sysrq.c drivers/gpu/drm/drm_drv.c +3 more+97 -00 replies
2/2drm/msm: Add sysrq_kill handlerdrivers/gpu/drm/msm/msm_drv.c drivers/gpu/drm/msm/msm_gpu.c drivers/gpu/drm/msm/msm_gpu.h+31 -00 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [RFC 0/2] drm: Add sysrq handler to kill GPU

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
Signature · 1 line
2.53.0