dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: Boris Brezillon <boris.brezillon@collabora.com>,
	dri-devel@lists.freedesktop.org
Cc: Steven Price <steven.price@arm.com>,
	Rob Herring <robh+dt@kernel.org>,
	Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>,
	Alex Deucher <alexander.deucher@amd.com>,
	Robin Murphy <robin.murphy@arm.com>
Subject: Re: [PATCH v2] drm/sched: Avoid infinite waits in the drm_sched_entity_destroy() path
Date: Fri, 2 Oct 2020 10:31:31 +0200	[thread overview]
Message-ID: <c62d5cab-a340-00cc-43ed-0a1edba76cc1@amd.com> (raw)
In-Reply-To: <20201002065518.1186013-1-boris.brezillon@collabora.com>

Am 02.10.20 um 08:55 schrieb Boris Brezillon:
> If we don't initialize the entity to idle and the entity is never
> scheduled before being destroyed we end up with an infinite wait in the
> destroy path.

Good catch, of hand I would say that this is valid.

>
> v2:
> - Add Steven's R-b
>
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> Reviewed-by: Steven Price <steven.price@arm.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

Should I pick it up for drm-misc-next? (Or maybe even -fixes?).

Thanks,
Christian.

> ---
> This is something I noticed while debugging another issue on panfrost
> causing the scheduler to be in a weird state where new entities were no
> longer scheduled. This was causing all userspace threads trying to close
> their DRM fd to be blocked in kernel space waiting for this "entity is
> idle" event. I don't know if that fix is legitimate (now that we fixed
> the other bug we don't seem to end up in that state anymore), but I
> thought I'd share it anyway.
> ---
>   drivers/gpu/drm/scheduler/sched_entity.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/scheduler/sched_entity.c b/drivers/gpu/drm/scheduler/sched_entity.c
> index 146380118962..f8ec277a6aa8 100644
> --- a/drivers/gpu/drm/scheduler/sched_entity.c
> +++ b/drivers/gpu/drm/scheduler/sched_entity.c
> @@ -73,6 +73,9 @@ int drm_sched_entity_init(struct drm_sched_entity *entity,
>   
>   	init_completion(&entity->entity_idle);
>   
> +	/* We start in an idle state. */
> +	complete(&entity->entity_idle);
> +
>   	spin_lock_init(&entity->rq_lock);
>   	spsc_queue_init(&entity->job_queue);
>   

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-10-02  8:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-02  6:55 [PATCH v2] drm/sched: Avoid infinite waits in the drm_sched_entity_destroy() path Boris Brezillon
2020-10-02  8:31 ` Christian König [this message]
2020-10-02 12:28   ` Boris Brezillon

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=c62d5cab-a340-00cc-43ed-0a1edba76cc1@amd.com \
    --to=christian.koenig@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=alyssa.rosenzweig@collabora.com \
    --cc=boris.brezillon@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=robh+dt@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=steven.price@arm.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