summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/scheduler
diff options
context:
space:
mode:
authorNayan Deshmukh <nayan26deshmukh@gmail.com>2018-08-01 13:50:00 +0530
committerAlex Deucher <alexander.deucher@amd.com>2018-08-27 11:09:45 -0500
commit249a07c05a8da9637c2eb3205f1fc739c216f707 (patch)
tree68481209b3e48bfda9f0c014fb7e0761c9d56740 /drivers/gpu/drm/scheduler
parentac0a6cf1c6ef91e4af2a9d56eeaee8fca61d6ad7 (diff)
drm/scheduler: add counter for total jobs in scheduler
To keep track of the scheduler load. Signed-off-by: Nayan Deshmukh <nayan26deshmukh@gmail.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/scheduler')
-rw-r--r--drivers/gpu/drm/scheduler/gpu_scheduler.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/scheduler/gpu_scheduler.c b/drivers/gpu/drm/scheduler/gpu_scheduler.c
index afffb9a60cdb..3b9969190927 100644
--- a/drivers/gpu/drm/scheduler/gpu_scheduler.c
+++ b/drivers/gpu/drm/scheduler/gpu_scheduler.c
@@ -530,6 +530,7 @@ void drm_sched_entity_push_job(struct drm_sched_job *sched_job,
trace_drm_sched_job(sched_job, entity);
+ atomic_inc(&entity->rq->sched->num_jobs);
WRITE_ONCE(entity->last_user, current->group_leader);
first = spsc_queue_push(&entity->job_queue, &sched_job->queue_node);
@@ -821,6 +822,7 @@ static void drm_sched_process_job(struct dma_fence *f, struct dma_fence_cb *cb)
dma_fence_get(&s_fence->finished);
atomic_dec(&sched->hw_rq_count);
+ atomic_dec(&sched->num_jobs);
drm_sched_fence_finished(s_fence);
trace_drm_sched_process_job(s_fence);
@@ -938,6 +940,7 @@ int drm_sched_init(struct drm_gpu_scheduler *sched,
INIT_LIST_HEAD(&sched->ring_mirror_list);
spin_lock_init(&sched->job_list_lock);
atomic_set(&sched->hw_rq_count, 0);
+ atomic_set(&sched->num_jobs, 0);
atomic64_set(&sched->job_id_count, 0);
/* Each scheduler will run on a seperate kernel thread */