From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Bert Karwatzki <spasswolf@web.de>
Cc: linux-kernel@vger.kernel.org, linux-next@vger.kernel.org,
linux-rt-devel@lists.linux.dev, amd-gfx@lists.freedesktop.org,
Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>,
Alex Deucher <alexander.deucher@amd.com>,
Rafal Ostrowski <rafal.ostrowski@amd.com>,
Mario Limonciello <mario.limonciello@amd.com>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH v7.2-rc6] drm/amd/display: fix usage of DC_FPU_{BEGIN,END} with PREEMPT_RT
Date: Fri, 28 Aug 2026 11:55:11 +0200 [thread overview]
Message-ID: <20260828095511.zrVXJUrU@linutronix.de> (raw)
In-Reply-To: <bd31938661f178abaa68d3958bacdc1ebb70ff5c.camel@web.de>
On 2026-08-27 23:07:08 [+0200], Bert Karwatzki wrote:
> Am Donnerstag, dem 27.08.2026 um 14:49 +0200 schrieb Sebastian Andrzej Siewior:
> > On 2026-08-07 14:49:42 [+0200], Bert Karwatzki wrote:
> > > On PREEMPT_RT kernels kvzalloc_obj() can sleep because spin_lock is
> > > converted to rt_mutex. dc_create_plane_state() can be called while
> > > inside an FPU-guarded region, resuling in "scheduling while atomic"
> > > errors on PREEMPT_RT kernels.
> > > Fix this by calling kvzalloc_obj() with DC_RUN_WITH_PREEMPTION_ENABLED().
> > > Also fix the error path in dc_create_stream_for_sink().
> > >
> > > Fixes: 3539437f354b ("drm/amd/display: Move FPU Guards From DML To DC - Part 1")
> > > Link: https://lore.kernel.org/lkml/20260723123449.6494-1-spasswolf@web.de/
> > > Signed-off-by: Bert Karwatzki <spasswolf@web.de>
> >
> > Thank you Bert. Got this somewhere in the meantime?
>
> No, this is seems to be stuck somewhere ...
halp!
> >
> > Could the FPU regions with disabled preemption be limited to where we
> > have actually have FPU usage in way that you don't have to worry when it
> > is needed to use DC_RUN_WITH_PREEMPTION_ENABLED() and when not? Also the
> > dc_fpu_begin()/ end() can nest and if they do the usage of
> > DC_RUN_WITH_PREEMPTION_ENABLED() is futile, isn't it?
> >
>
> I'm not very familiar with the amd display engine, and it's a lot of code,
> but there I think there's some room for improvement, e.g. dml2_destroy():
>
> dml2_destroy is called from dc_state_free() from within DC_FP_{START,END}()
> and then basically just calls vfree with DC_RUN_WITH_PREEMPTION_ENABLED().
> (directly or through dml21_destroy()). Here both the DC_FP_*() tags and
> DC_RUN_WITH_PREEMPTION_ENABLED() could be dropped I think (not tested, yet)
>
> Regarding nesting DC_FP_*()s: When I was searching for the cause of the
> kernel panics I monitored every DC_FP_{START,END}() with printk(), and I
> don't think I encountered nesting (the logs are lost unfortunately)
I am not saying it is nesting, just the START/STOP API is able to deal
this. Otherwise kernel_fpu_being/end() could be used directly. And
DC_RUN_WITH_PREEMPTION_ENABLED() is not able to deal with nesting.
On PREEMPT_RT it could be bad for the max observed latency if this nests
or has otherwise an unbound runtime. For crypto there an maximum amount
of input data which can be processed within a single FPU disabled
section. The "cheaper" second kernel_fpu_begin() makes it possible.
> > The first usage kernel_fpu_begin() saves the FPU state to the user task.
> > kernel_fpu_end() does not restore it. Therefore the subsequent
> > invocation of kernel_fpu_begin() is cheaper.
> >
> > Sebastian
>
> Bert Karwatzki
Sebastian
prev parent reply other threads:[~2026-08-28 9:55 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-23 12:34 kernel panic during shutdown in v7.2-rc4 and next-20260722 with PREEMPT_RT Bert Karwatzki
2026-07-23 12:43 ` [Re] " Bert Karwatzki
2026-07-23 13:10 ` [Re] kernel panic during shutdown in v7.2-rc{3,4} " Bert Karwatzki
2026-07-23 13:10 ` [Re] kernel panic during shutdown in v7.2-rc{3, 4} " Bert Karwatzki
2026-07-23 13:23 ` [Re] kernel panic during shutdown in v7.2-rc{3,4} " Bert Karwatzki
2026-07-23 16:17 ` Bert Karwatzki
2026-07-23 22:51 ` [Re] kernel panic during shutdown in next-20260722 Bert Karwatzki
2026-07-24 15:08 ` Bert Karwatzki
2026-07-25 19:58 ` Bert Karwatzki
2026-07-25 23:16 ` Bert Karwatzki
2026-07-26 18:47 ` Bert Karwatzki
2026-07-26 22:52 ` Bert Karwatzki
2026-07-27 10:06 ` [Re] kernel panic during shutdown in v7.1+ with PREEMPT_RT Bert Karwatzki
2026-07-27 10:35 ` Ostrowski, Rafal
2026-07-27 10:50 ` [PATCH] drm/amd/display: fix usage of DC_FPU_{BEGIN,END} " Bert Karwatzki
2026-07-27 11:11 ` sashiko-bot
2026-07-28 0:51 ` mikhail.v.gavrilov
2026-07-29 12:35 ` Bert Karwatzki
2026-07-29 14:39 ` Mikhail Gavrilov
2026-07-29 14:39 ` [PATCH] drm/amd/display: fix usage of DC_FPU_{BEGIN, END} " Mikhail Gavrilov
2026-07-29 17:46 ` [PATCH] drm/amd/display: fix usage of DC_FPU_{BEGIN,END} " Bert Karwatzki
2026-08-01 7:17 ` Bert Karwatzki
2026-08-01 7:17 ` [PATCH] drm/amd/display: fix usage of DC_FPU_{BEGIN, END} " Bert Karwatzki
2026-08-01 7:35 ` [PATCH] drm/amd/display: fix usage of DC_FPU_{BEGIN,END} " sashiko-bot
2026-08-01 10:17 ` Mikhail Gavrilov
2026-08-01 10:17 ` [PATCH] drm/amd/display: fix usage of DC_FPU_{BEGIN, END} " Mikhail Gavrilov
2026-08-07 12:58 ` [PATCH] drm/amd/display: fix usage of DC_FPU_{BEGIN,END} " Bert Karwatzki
2026-08-07 12:58 ` [PATCH] drm/amd/display: fix usage of DC_FPU_{BEGIN, END} " Bert Karwatzki
2026-08-07 13:31 ` [PATCH] drm/amd/display: fix usage of DC_FPU_{BEGIN,END} " sashiko-bot
2026-08-06 3:47 ` kernel test robot
2026-08-06 4:29 ` kernel test robot
2026-08-07 12:49 ` [PATCH v7.2-rc6] " Bert Karwatzki
2026-08-07 12:49 ` [PATCH v7.2-rc6] drm/amd/display: fix usage of DC_FPU_{BEGIN, END} " Bert Karwatzki
2026-08-07 13:13 ` [PATCH v7.2-rc6] drm/amd/display: fix usage of DC_FPU_{BEGIN,END} " sashiko-bot
2026-08-07 14:00 ` Greg KH
2026-08-27 12:49 ` Sebastian Andrzej Siewior
2026-08-27 21:07 ` Bert Karwatzki
2026-08-28 9:55 ` Sebastian Andrzej Siewior [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=20260828095511.zrVXJUrU@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=mario.limonciello@amd.com \
--cc=mikhail.v.gavrilov@gmail.com \
--cc=rafal.ostrowski@amd.com \
--cc=spasswolf@web.de \
--cc=tglx@linutronix.de \
/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.