Re: [PATCH] drm/amd/display: fix usage of DC_FPU_{BEGIN,END} with PREEMPT_RT

Bert Karwatzki <[email protected]> Wed, 29 Jul 2026 19:46:30 +0200
Newsgroups dev.linux.lists.linux-rt-devel,org.freedesktop.lists.amd-gfx,org.kernel.vger.linux-kernel,org.kernel.vger.linux-next,org.kernel.vger.stable
Message-ID <[email protected]>
Am Dienstag, dem 28.07.2026 um 05:51 +0500 schrieb mikhail.v.gavrilov@gmai=
l.com:
> One thing that may be worth adjusting in the commit message: this is
> not only a PREEMPT_RT problem.  183182235f6d was needed on a plain non-
> RT x86 kernel. There DC_FP_START() takes fpregs_lock(), which disables
> local softirqs, and dc_plane_state is around 335 KiB, so kvzalloc_obj()
> falls through to the vmalloc path and hits BUG_ON(in_interrupt()).  So
> on RT any allocation inside the FPU region is illegal, while on non-RT
> it is specifically the large ones - two failure modes, one root cause.

I think this was true when commit=C2=A0
183182235f6d ("drm/amd/display: Wrap DCN32 phantom-plane allocation in DC_=
RUN_WITH_PREEMPTION_ENABLED")
was commited, but commit
04aa71da5f35 ("mm/vmalloc: do not trigger BUG() on BH disabled context")
changed the BUG_ON() in __get_vm_area_node():
diff --git a/mm/vmalloc.c b/mm/vmalloc.c

index c31a8615a832..bb6ae08d18f5 100644
=2D-- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -3203,7 +3203,7 @@ struct vm_struct *__get_vm_area_node(unsigned long s=
ize,
        struct vm_struct *area;
        unsigned long requested_size =3D size;
=20
-       BUG_ON(in_interrupt());
+       BUG_ON(in_nmi() || in_hardirq());
        size =3D ALIGN(size, 1ul << shift);
        if (unlikely(!size))
                return NULL;

so on non-PREEMPT_RT kernels DC_RUN_WITH_PREEMPTION_ENABLED is no
longer required for DCN32 phantom-plane allocation.

Bert Karwatzki