From: Steven Price <steven.price@arm.com>
To: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Cc: Emily.Deng@amd.com, dri-devel@lists.freedesktop.org,
amd-gfx@lists.freedesktop.org, Christian.Koenig@amd.com
Subject: Re: [PATCH v3 1/2] drm/sched: Avoid job cleanup if sched thread is parked.
Date: Mon, 25 Nov 2019 16:51:58 +0000 [thread overview]
Message-ID: <93c692cb-5306-e024-57f1-463402cb2c44@arm.com> (raw)
In-Reply-To: <1574691041-5499-1-git-send-email-andrey.grodzovsky@amd.com>
On 25/11/2019 14:10, Andrey Grodzovsky wrote:
> When the sched thread is parked we assume ring_mirror_list is
> not accessed from here.
FWIW I don't think this is necessary. kthread_park() will wait until the
thread is parked, at which point the thread is stuck in kthread_parkme()
until unparked.
So all this does is avoid waiting for any cleanup jobs before parking -
which might be a reasonable goal in itself, but if so lets at least
document that.
Steve
>
> Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
> Reviewed-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/scheduler/sched_main.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c
> index d4cc728..6774955 100644
> --- a/drivers/gpu/drm/scheduler/sched_main.c
> +++ b/drivers/gpu/drm/scheduler/sched_main.c
> @@ -635,9 +635,13 @@ drm_sched_get_cleanup_job(struct drm_gpu_scheduler *sched)
> struct drm_sched_job *job;
> unsigned long flags;
>
> - /* Don't destroy jobs while the timeout worker is running */
> - if (sched->timeout != MAX_SCHEDULE_TIMEOUT &&
> - !cancel_delayed_work(&sched->work_tdr))
> + /*
> + * Don't destroy jobs while the timeout worker is running OR thread
> + * is being parked and hence assumed to not touch ring_mirror_list
> + */
> + if ((sched->timeout != MAX_SCHEDULE_TIMEOUT &&
> + !cancel_delayed_work(&sched->work_tdr)) ||
> + __kthread_should_park(sched->thread))
> return NULL;
>
> spin_lock_irqsave(&sched->job_list_lock, flags);
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2019-11-25 16:51 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-25 14:10 [PATCH v3 1/2] drm/sched: Avoid job cleanup if sched thread is parked Andrey Grodzovsky
2019-11-25 14:10 ` Andrey Grodzovsky
2019-11-25 14:10 ` [PATCH v3 2/2] drm/scheduler: Avoid accessing freed bad job Andrey Grodzovsky
2019-11-25 14:10 ` Andrey Grodzovsky
[not found] ` <1574691041-5499-2-git-send-email-andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org>
2019-11-25 16:57 ` Steven Price
2019-11-25 16:57 ` Steven Price
2019-11-25 16:51 ` Steven Price [this message]
2019-11-26 9:08 ` [PATCH v3 1/2] drm/sched: Avoid job cleanup if sched thread is parked Christian König
2019-11-26 15:36 ` Andrey Grodzovsky
2019-11-27 15:32 ` Andrey Grodzovsky
[not found] ` <b3835ff0-15f0-ead4-0255-3d93fc560c77-5C7GfCeVMHo@public.gmane.org>
2019-11-27 15:35 ` Christian König
2019-11-27 15:35 ` 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=93c692cb-5306-e024-57f1-463402cb2c44@arm.com \
--to=steven.price@arm.com \
--cc=Christian.Koenig@amd.com \
--cc=Emily.Deng@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=andrey.grodzovsky@amd.com \
--cc=dri-devel@lists.freedesktop.org \
/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