[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c7dab9de-9014-720a-ac11-77d87e8231c5@amd.com>
Date: Wed, 12 Jul 2023 10:43:21 +0200
From: Christian König <christian.koenig@....com>
To: André Almeida <andrealmeid@...lia.com>,
dri-devel@...ts.freedesktop.org, amd-gfx@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Cc: kernel-dev@...lia.com, alexander.deucher@....com,
pierre-eric.pelloux-prayer@....com,
'Marek Olšák' <maraeo@...il.com>,
Samuel Pitoiset <samuel.pitoiset@...il.com>,
Bas Nieuwenhuizen <bas@...nieuwenhuizen.nl>,
Timur Kristóf <timur.kristof@...il.com>,
michel.daenzer@...lbox.org,
Michel Dänzer <michel@...nzer.net>
Subject: Re: [PATCH 2/6] drm/amdgpu: Mark contexts guilty for causing soft
recoveries
Am 11.07.23 um 23:34 schrieb André Almeida:
> If a DRM fence is set to -ENODATA, that means that this context was a
> cause of a soft reset, but is never marked as guilty. Flag it as guilty
> and log to user that this context won't accept more submissions.
>
> Signed-off-by: André Almeida <andrealmeid@...lia.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> index 0dc9c655c4fb..fe8e47d063da 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
> @@ -459,6 +459,12 @@ int amdgpu_ctx_get_entity(struct amdgpu_ctx *ctx, u32 hw_ip, u32 instance,
> ctx_entity = &ctx->entities[hw_ip][ring]->entity;
> r = drm_sched_entity_error(ctx_entity);
> if (r) {
> + if (r == -ENODATA) {
> + DRM_ERROR("%s (%d) context caused a reset,"
> + "marking it guilty and refusing new submissions.\n",
> + current->comm, current->pid);
> + atomic_set(&ctx->guilty, 1);
> + }
I'm going back and forth with that as well.
Michel has a very good point that it often is sufficient to cancel just
one rough shader to keep going.
But Marek has a very good point as well that when that happens multiple
times we probably want to block the application from making further
submissions.
Christian.
> DRM_DEBUG("error entity %p\n", ctx_entity);
> return r;
> }
Powered by blists - more mailing lists