[Bug 277476] graphics/drm-515-kmod: amdgpu periodic hangs due to phys contig allocations

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 11 Jul 2025 05:24:41 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277476

--- Comment #27 from sigsys@gmail.com ---
Welp, I just upgraded to 14.3-RELEASE and I got the same memory fragmentation
related slowdowns. Using drm-kmod's 6.1 branch.

It's pretty much the same problem (just happening through a different route) so
I'll post it here rather than opening a new PR...

The fix seems even simpler this time:

diff --git a/sys/compat/linuxkpi/common/include/linux/slab.h
b/sys/compat/linuxkpi/common/include/linux/slab.h
index f3a840d9bf4b..efa5c8cb67b3 100644
--- a/sys/compat/linuxkpi/common/include/linux/slab.h
+++ b/sys/compat/linuxkpi/common/include/linux/slab.h
@@ -45,7 +45,7 @@

 MALLOC_DECLARE(M_KMALLOC);

-#define        kvzalloc(size, flags)           kmalloc(size, (flags) |
__GFP_ZERO)
+#define        kvzalloc(size, flags)           kvmalloc(size, (flags) |
__GFP_ZERO)
 #define        kvcalloc(n, size, flags)        kvmalloc_array(n, size, (flags)
| __GFP_ZERO)
 #define        kzalloc(size, flags)            kmalloc(size, (flags) |
__GFP_ZERO)
 #define        kzalloc_node(size, flags, node) kmalloc_node(size, (flags) |
__GFP_ZERO, node)

amdgpu's dc_create_state() is making large-ish (~145KB) allocations with
kvzalloc() which lead to the same slowdowns in
vm_page_reclaim_contig_domain_ext().

There's also a kzalloc() call in amdgpu's bw_calcs() function asking for 14400
bytes that possibly could be turned into a kvzalloc().

-- 
You are receiving this mail because:
You are on the CC list for the bug.