mirror of
https://github.com/torvalds/linux.git
synced 2026-05-21 13:27:57 +02:00
drm/msm: Split out helper to get comm/cmdline
Deduplicate this from fault_worker and recover_worker. Signed-off-by: Rob Clark <robdclark@chromium.org> Link: https://lore.kernel.org/r/20220317165144.222101-3-robdclark@gmail.com Signed-off-by: Rob Clark <robdclark@chromium.org>
This commit is contained in:
parent
4bfba71640
commit
39ba0c0d6c
|
|
@ -351,6 +351,20 @@ find_submit(struct msm_ringbuffer *ring, uint32_t fence)
|
|||
|
||||
static void retire_submits(struct msm_gpu *gpu);
|
||||
|
||||
static void get_comm_cmdline(struct msm_gem_submit *submit, char **comm, char **cmd)
|
||||
{
|
||||
struct task_struct *task;
|
||||
|
||||
task = get_pid_task(submit->pid, PIDTYPE_PID);
|
||||
if (!task)
|
||||
return;
|
||||
|
||||
*comm = kstrdup(task->comm, GFP_KERNEL);
|
||||
*cmd = kstrdup_quotable_cmdline(task, GFP_KERNEL);
|
||||
|
||||
put_task_struct(task);
|
||||
}
|
||||
|
||||
static void recover_worker(struct kthread_work *work)
|
||||
{
|
||||
struct msm_gpu *gpu = container_of(work, struct msm_gpu, recover_work);
|
||||
|
|
@ -367,18 +381,11 @@ static void recover_worker(struct kthread_work *work)
|
|||
|
||||
submit = find_submit(cur_ring, cur_ring->memptrs->fence + 1);
|
||||
if (submit) {
|
||||
struct task_struct *task;
|
||||
|
||||
/* Increment the fault counts */
|
||||
submit->queue->faults++;
|
||||
submit->aspace->faults++;
|
||||
|
||||
task = get_pid_task(submit->pid, PIDTYPE_PID);
|
||||
if (task) {
|
||||
comm = kstrdup(task->comm, GFP_KERNEL);
|
||||
cmd = kstrdup_quotable_cmdline(task, GFP_KERNEL);
|
||||
put_task_struct(task);
|
||||
}
|
||||
get_comm_cmdline(submit, &comm, &cmd);
|
||||
|
||||
if (comm && cmd) {
|
||||
DRM_DEV_ERROR(dev->dev, "%s: offending task: %s (%s)\n",
|
||||
|
|
@ -467,14 +474,7 @@ static void fault_worker(struct kthread_work *work)
|
|||
goto resume_smmu;
|
||||
|
||||
if (submit) {
|
||||
struct task_struct *task;
|
||||
|
||||
task = get_pid_task(submit->pid, PIDTYPE_PID);
|
||||
if (task) {
|
||||
comm = kstrdup(task->comm, GFP_KERNEL);
|
||||
cmd = kstrdup_quotable_cmdline(task, GFP_KERNEL);
|
||||
put_task_struct(task);
|
||||
}
|
||||
get_comm_cmdline(submit, &comm, &cmd);
|
||||
|
||||
/*
|
||||
* When we get GPU iova faults, we can get 1000s of them,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user