From: Philipp Stanner <phasta@mailbox.org>
To: "Christian König" <ckoenig.leichtzumerken@gmail.com>,
phasta@kernel.org, alexdeucher@gmail.com, simona.vetter@ffwll.ch,
faith@gfxstrand.net, sumit.semwal@linaro.org
Cc: linaro-mm-sig@lists.linaro.org, dri-devel@lists.freedesktop.org,
dakr@kernel.org, Lyude Paul <lyude@redhat.com>
Subject: Re: [PATCH 4/4] drm/sched: warn and taint the kernel when maximum timeout is exceeded.
Date: Tue, 25 Nov 2025 09:08:26 +0100 [thread overview]
Message-ID: <14e674a02c9028ea20b448c68cd24a987ee239cd.camel@mailbox.org> (raw)
In-Reply-To: <20251120150018.27385-5-christian.koenig@amd.com>
+Cc Lyude, Danilo
On Thu, 2025-11-20 at 15:41 +0100, Christian König wrote:
> Exceeding the recommended maximum timeout should be noted in logs and
> crash dumps.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
> drivers/gpu/drm/scheduler/sched_main.c | 12 +++++++++++-
> 1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/scheduler/sched_main.c b/drivers/gpu/drm/scheduler/sched_main.c
> index 1d4f1b822e7b..88e24e140def 100644
> --- a/drivers/gpu/drm/scheduler/sched_main.c
> +++ b/drivers/gpu/drm/scheduler/sched_main.c
> @@ -1318,12 +1318,22 @@ int drm_sched_init(struct drm_gpu_scheduler *sched, const struct drm_sched_init_
> sched->ops = args->ops;
> sched->credit_limit = args->credit_limit;
> sched->name = args->name;
> - sched->timeout = args->timeout;
> sched->hang_limit = args->hang_limit;
> sched->timeout_wq = args->timeout_wq ? args->timeout_wq : system_percpu_wq;
> sched->score = args->score ? args->score : &sched->_score;
> sched->dev = args->dev;
>
> + sched->timeout = args->timeout;
> + if (sched->timeout > DMA_FENCE_MAX_REASONABLE_TIMEOUT) {
> + dev_warn(sched->dev, "Timeout %ld exceeds the maximum recommended one!\n",
> + sched->timeout);
> + /*
> + * Make sure that exceeding the recommendation is noted in
> + * logs and crash dumps.
> + */
> + add_taint(TAINT_SOFTLOCKUP, LOCKDEP_STILL_OK);
> + }
> +
I have to NACK this in the current form, it would cause a bunch of
drivers to fire warnings, despite there being absolutely nothing wrong
with them in the past
https://elixir.bootlin.com/linux/v6.18-rc6/source/drivers/gpu/drm/nouveau/nouveau_sched.c#L412
https://elixir.bootlin.com/linux/v6.18-rc6/source/drivers/gpu/drm/lima/lima_sched.c#L519
I guess there are more.
Nouveau's current timeout is an astonishing 10 seconds, and AFAIK there
has never been a problem with that. If you want to declare this
behavior invalid, you need to discuss that with the Nouveau maintainers
first.
It also didn't become clear to me why dma_fence is to define a timeout
rule? I like to think that "must be signalled within reasonable time"
is as precise as it gets. As demonstrated by the drivers, there is just
no objectively correct definiton of "reasonable".
BTW your series doesn't make clear to me why you only touch very few
components: there are many more users of dma_fence than just vgem and
sched. What about the others?
P.
prev parent reply other threads:[~2025-11-25 8:08 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-20 14:41 Reasonable maximum signaling timeout for dma_fences Christian König
2025-11-20 14:41 ` [PATCH 1/4] dma-buf/fence: give some reasonable maximum signaling timeout Christian König
2025-11-25 7:55 ` Philipp Stanner
2025-11-25 8:03 ` Christian König
2025-11-25 8:13 ` Philipp Stanner
2025-11-25 8:48 ` Christian König
2025-11-25 10:56 ` Philipp Stanner
2025-11-25 14:26 ` Christian König
2025-11-25 16:03 ` Philipp Stanner
2025-11-25 17:02 ` Lucas Stach
2025-11-26 12:31 ` Christian König
2025-11-26 12:37 ` Philipp Stanner
2025-11-26 15:03 ` Christian König
2025-11-26 15:44 ` Philipp Stanner
2025-11-26 15:59 ` Lucas Stach
2025-11-26 16:11 ` Lucas Stach
2025-12-05 13:14 ` Christian König
2025-11-20 14:41 ` [PATCH 2/4] dma-buf/sw-sync: always taint the kernel when sw-sync is used Christian König
2025-11-25 2:58 ` Sumit Semwal
2025-11-20 14:41 ` [PATCH 3/4] drm/vgem: use the reasonable maximum timeout defined by the dma_fence Christian König
2025-11-25 7:56 ` Philipp Stanner
2025-11-20 14:41 ` [PATCH 4/4] drm/sched: warn and taint the kernel when maximum timeout is exceeded Christian König
2025-11-25 8:08 ` Philipp Stanner [this message]
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=14e674a02c9028ea20b448c68cd24a987ee239cd.camel@mailbox.org \
--to=phasta@mailbox.org \
--cc=alexdeucher@gmail.com \
--cc=ckoenig.leichtzumerken@gmail.com \
--cc=dakr@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=faith@gfxstrand.net \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=lyude@redhat.com \
--cc=phasta@kernel.org \
--cc=simona.vetter@ffwll.ch \
--cc=sumit.semwal@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.