From: Nirmoy <nirmodas@amd.com>
To: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com>,
Nirmoy Das <nirmoy.aiemd@gmail.com>,
amd-gfx@lists.freedesktop.org
Cc: Boyuan.Zhang@amd.com, nirmoy.das@amd.com,
alexander.deucher@amd.com, James.Zhu@amd.com, Leo.Liu@amd.com,
christian.koenig@amd.com
Subject: Re: [RFC PATCH 1/2] drm/sched: implement drm_sched_entity_num_jobs
Date: Wed, 11 Mar 2020 18:58:05 +0100 [thread overview]
Message-ID: <2c445cde-ce1c-f46e-25dc-22c11f8e9b59@amd.com> (raw)
In-Reply-To: <98391772-ecca-035e-73ff-26a3d5c8286b@amd.com>
On 3/11/20 6:23 PM, Andrey Grodzovsky wrote:
>
> On 3/11/20 1:18 PM, Nirmoy Das wrote:
>> Implement drm_sched_entity_num_jobs() so that drm drivers can
>> query number of jobs in an entity.
>>
>> Signed-off-by: Nirmoy Das <nirmoy.das@amd.com>
>> ---
>> drivers/gpu/drm/scheduler/sched_entity.c | 15 +++++++++++++++
>> include/drm/gpu_scheduler.h | 1 +
>> 2 files changed, 16 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/scheduler/sched_entity.c
>> b/drivers/gpu/drm/scheduler/sched_entity.c
>> index 90fd9c30ae5a..dfe8216f2d52 100644
>> --- a/drivers/gpu/drm/scheduler/sched_entity.c
>> +++ b/drivers/gpu/drm/scheduler/sched_entity.c
>> @@ -119,6 +119,21 @@ static bool drm_sched_entity_is_idle(struct
>> drm_sched_entity *entity)
>> return false;
>> }
>> +/**
>> + * drm_sched_entity_num_job - Get number of jobs in the entity
typo s/drm_sched_entity_num_job/drm_sched_entity_num_jobs
>> + *
>> + * @entity: scheduler entity
>> + *
>> + * Returns number of jobs in the entity
>> + */
>> +int drm_sched_entity_num_jobs(struct drm_sched_entity *entity)
>> +{
>> + if (drm_sched_entity_is_idle(entity))
>> + return 0;
>> +
>> + return spsc_queue_count(&entity->job_queue);
>> +}
>
>
> What about the jobs which already have been dequeued from job_queue
> and are in progress in the HW ring but yet to complete - don't they
> count ?
Hi Andrey,
I am thinking in terms of software side of the counting because for an
entity once a job dequeued, that job is completely lost.
I might be wrong here that's why tagged RFC :)
Regards,
Nirmoy
>
> Andrey
>
>
>
>> +EXPORT_SYMBOL(drm_sched_entity_num_jobs);
>> /**
>> * drm_sched_entity_is_ready - Check if entity is ready
>> *
>> diff --git a/include/drm/gpu_scheduler.h b/include/drm/gpu_scheduler.h
>> index d8972836d248..b5ceff75cbbe 100644
>> --- a/include/drm/gpu_scheduler.h
>> +++ b/include/drm/gpu_scheduler.h
>> @@ -341,5 +341,6 @@ void drm_sched_fence_finished(struct
>> drm_sched_fence *fence);
>> unsigned long drm_sched_suspend_timeout(struct drm_gpu_scheduler
>> *sched);
>> void drm_sched_resume_timeout(struct drm_gpu_scheduler *sched,
>> unsigned long remaining);
>> +int drm_sched_entity_num_jobs(struct drm_sched_entity *entity);
>> #endif
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2020-03-11 17:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-11 17:18 [RFC PATCH 1/2] drm/sched: implement drm_sched_entity_num_jobs Nirmoy Das
2020-03-11 17:18 ` [RFC PATCH 2/2] drm/amdgpu: disable gpu load balancer for vcn jobs Nirmoy Das
2020-03-11 18:03 ` Christian König
2020-03-11 18:47 ` Nirmoy
2020-03-11 17:23 ` [RFC PATCH 1/2] drm/sched: implement drm_sched_entity_num_jobs Andrey Grodzovsky
2020-03-11 17:58 ` Nirmoy [this message]
2020-03-11 17:57 ` Christian König
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2c445cde-ce1c-f46e-25dc-22c11f8e9b59@amd.com \
--to=nirmodas@amd.com \
--cc=Andrey.Grodzovsky@amd.com \
--cc=Boyuan.Zhang@amd.com \
--cc=James.Zhu@amd.com \
--cc=Leo.Liu@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=nirmoy.aiemd@gmail.com \
--cc=nirmoy.das@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox