public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: "André Almeida" <andrealmeid@igalia.com>,
	dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Cc: kernel-dev@igalia.com, alexander.deucher@amd.com,
	pierre-eric.pelloux-prayer@amd.com,
	"'Marek Olšák'" <maraeo@gmail.com>,
	"Samuel Pitoiset" <samuel.pitoiset@gmail.com>,
	"Bas Nieuwenhuizen" <bas@basnieuwenhuizen.nl>,
	"Timur Kristóf" <timur.kristof@gmail.com>,
	michel.daenzer@mailbox.org, "Michel Dänzer" <michel@daenzer.net>
Subject: Re: [PATCH 2/6] drm/amdgpu: Mark contexts guilty for causing soft recoveries
Date: Wed, 12 Jul 2023 10:43:21 +0200	[thread overview]
Message-ID: <c7dab9de-9014-720a-ac11-77d87e8231c5@amd.com> (raw)
In-Reply-To: <20230711213501.526237-3-andrealmeid@igalia.com>



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@igalia.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;
>   	}


  reply	other threads:[~2023-07-12  8:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-11 21:34 [PATCH 0/6] drm/amdgpu: Add new reset option and rework coredump André Almeida
2023-07-11 21:34 ` [PATCH 1/6] drm/amdgpu: Create a module param to disable soft recovery André Almeida
2023-07-11 21:34 ` [PATCH 2/6] drm/amdgpu: Mark contexts guilty for causing soft recoveries André Almeida
2023-07-12  8:43   ` Christian König [this message]
2023-07-11 21:34 ` [PATCH 3/6] drm/amdgpu: Rework coredump to use memory dynamically André Almeida
2023-07-12  8:37   ` Christian König
2023-07-12  8:59     ` Lucas Stach
2023-07-12 10:39       ` Christian König
2023-07-12 10:46         ` Lucas Stach
2023-07-12 10:56         ` Lucas Stach
2023-07-12 11:36           ` Christian König
2023-07-11 21:34 ` [PATCH 4/6] drm/amdgpu: Limit info in coredump for kernel threads André Almeida
2023-07-11 21:35 ` [PATCH 5/6] drm/amdgpu: Log IBs and ring name at coredump André Almeida
2023-07-11 21:35 ` [PATCH 6/6] drm/amdgpu: Create version number for coredumps André Almeida

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=c7dab9de-9014-720a-ac11-77d87e8231c5@amd.com \
    --to=christian.koenig@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=andrealmeid@igalia.com \
    --cc=bas@basnieuwenhuizen.nl \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel-dev@igalia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maraeo@gmail.com \
    --cc=michel.daenzer@mailbox.org \
    --cc=michel@daenzer.net \
    --cc=pierre-eric.pelloux-prayer@amd.com \
    --cc=samuel.pitoiset@gmail.com \
    --cc=timur.kristof@gmail.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