Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Jul 2026 15:01:57 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 297121] LinuxKPI: uma_zalloc_debug: zone "malloc-16" with the following non-sleepable locks held (alloc_bounce_zone)
Message-ID:  <bug-297121-227@https.bugs.freebsd.org/bugzilla/>

index | next in thread | raw e-mail

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=297121

            Bug ID: 297121
           Summary: LinuxKPI: uma_zalloc_debug: zone "malloc-16" with the
                    following non-sleepable locks held (alloc_bounce_zone)
           Product: Base System
           Version: CURRENT
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: bz@FreeBSD.org
                CC: jhb@FreeBSD.org, markj@FreeBSD.org

I got a problem report on testing a wireless driver (unrelated as the problem
is in general LinuxKPI code).
Filing the PR as I currently cannot debug it to the end and do not want to lose
it.
I cannot remember this reported in the last years.

amd64, 16GB memory, but in general it seems this is LinuxKPI holding the lock
and running into the alloc_bounce_zone() case which adds sysctls which will
malloc with M_WAITOK (compared to everything else in the path).

Cc: jhb, markj as you've done some the bounce buffer paths for this.  I wonder
how to best avoid that problem.

Multiple of these with different malloc-XXx zones:

uma_zalloc_debug: zone "malloc-16" with the following non-sleepable locks held:
exclusive sleep mutex lkpi-priv-dma (lkpi-priv-dma) r = 0 (0xfffff800115263a0)
locked @ /usr/src/sys/compat/linuxkpi/common/src/linux_pci.c:1746
stack backtrace:
#0 0xffffffff80c8f27c at witness_debugger+0x6c
#1 0xffffffff80c90b7c at witness_warn+0x4bc
#2 0xffffffff8100596f at uma_zalloc_debug+0x3f
#3 0xffffffff810054b7 at uma_zalloc_arg+0x27
#4 0xffffffff80be07dd at malloc+0x7d
#5 0xffffffff80c20ffb at sysctl_add_oid+0x6b
#6 0xffffffff81155d3f at alloc_bounce_zone+0x19f
#7 0xffffffff81154ca0 at bounce_bus_dmamap_create+0x180
#8 0xffffffff80ef467f at linux_dma_map_phys_common+0x9f
#9 0xffffffff80ef4514 at lkpi_dma_map_phys+0x24
...
lock order reversal: (sleepable after non-sleepable)
 1st 0xfffff800115263a0 lkpi-priv-dma (lkpi-priv-dma, sleep mutex) @
/usr/src/sys/compat/linuxkpi/common/src/linux_pci.c:1746
 2nd 0xffffffff81de6ce8 sysctl lock (sysctl lock, sleepable rm) @
/usr/src/sys/kern/kern_sysctl.c:886
lock order lkpi-priv-dma -> sysctl lock attempted at:
#0 0xffffffff80c8ee3b at witness_checkorder+0xd3b
#1 0xffffffff80c09a14 at _rm_wlock_debug+0x64
#2 0xffffffff80c21070 at sysctl_add_oid+0xe0
#3 0xffffffff81155d3f at alloc_bounce_zone+0x19f
#4 0xffffffff81154ca0 at bounce_bus_dmamap_create+0x180
#5 0xffffffff80ef467f at linux_dma_map_phys_common+0x9f
#6 0xffffffff80ef4514 at lkpi_dma_map_phys+0x24
...

-- 
You are receiving this mail because:
You are the assignee for the bug.

home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-297121-227>