kern/89310: panic: kmem_malloc fails with "kmem_map too small" in ata_alloc_composite

Peter R. Trimmel ptrimmel at
Sun Nov 20 12:00:55 GMT 2005

>Number:         89310
>Category:       kern
>Synopsis:       panic: kmem_malloc fails with  "kmem_map too small" in ata_alloc_composite
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Nov 20 12:00:49 GMT 2005
>Originator:     Peter R. Trimmel
>Release:        6.0-STABLE
FreeBSD 6.0-STABLE FreeBSD 6.0-STABLE #1: Sun Nov 20 10:29:28 CET 2005     ptrimmel at  i386
FreeBSD 6.0-RELASE and 6.0-STABLE (CVS 11/20) crash after panic in kmem_alloc.

FTP copy of 27GB tar archive to this machine fails repeatedly.
/usr/bin/top shows 52M wired mem when transfer starts and ~128M wired mem shortly before before panic. 10GB have been copied so far.

increasing vm.kmem_size in loader.conf to twice the calculated size (="257581056") delays the panic. wired mem grows to ~256M now. 20GB have been copied.

I initially used GEOM_MIRROR and GEOM_STRIPE for the RAID0+1 setup but soon noticed random "adNN failed to start: out of memory" messages due to kmem_alloc failures. However GEOM did not crash but caused file system corruptions. So I switched back to ATARAID which causes panics but at least leaves the file system structures intact.

FreeBSD 5.4-RELEASE did not panic in ATARAID 
FreeBSD 4.11-RELEASE did not panic in ATARAID (switched back to this version now, works flawlessly)

-- KGDB --
DOH! ata_alloc_composite failed!
panic: kmem_malloc(4096): kmem_map too small: 128790528 total allocated
Uptime: 2h1m19s
Dumping 383 MB (2 chunks)
  chunk 0: 1MB (156 pages) ... ok
  chunk 1: 383MB (98044 pages) 368 352 336 320 304 288 272 256 240 224 208 192 176 160 144 128 112 96 80 64 48 32 16

#0  doadump () at pcpu.h:165
165             __asm __volatile("movl %%fs:0,%0" : "=r" (td));
(kgdb) backtrace
#0  doadump () at pcpu.h:165
#1  0xc06abfe0 in boot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:399
#2  0xc06ac329 in panic (fmt=0xc095cde1 "kmem_malloc(%ld): kmem_map too small: %ld total allocated")
    at /usr/src/sys/kern/kern_shutdown.c:555
#3  0xc086a50b in kmem_malloc (map=0xc10430c0, size=4096, flags=1026) at /usr/src/sys/vm/vm_kern.c:299
#4  0xc085fb77 in page_alloc (zone=0xc104d800, bytes=0, pflag=0x0, wait=0) at /usr/src/sys/vm/uma_core.c:958
#5  0xc085f570 in slab_zalloc (zone=0xc104d800, wait=1026) at /usr/src/sys/vm/uma_core.c:823
#6  0xc0861392 in uma_zone_slab (zone=0xc104d800, flags=1282) at /usr/src/sys/vm/uma_core.c:2025
#7  0xc086160f in uma_zalloc_bucket (zone=0xc104d800, flags=1282) at /usr/src/sys/vm/uma_core.c:2134
#8  0xc08611c6 in uma_zalloc_arg (zone=0xc104d800, udata=0x0, flags=1282) at /usr/src/sys/vm/uma_core.c:1942
#9  0xc069e9c8 in malloc (size=64, mtp=0xc09dc2c0, flags=1282) at uma.h:275
#10 0xc083d001 in newallocindir (ip=0xc1db7c60, ptrno=0, newblkno=Unhandled dwarf expression opcode 0x93
) at /usr/src/sys/ufs/ffs/ffs_softdep.c:1818
#11 0xc083d0a0 in softdep_setup_allocindir_page (ip=0xc1db7c60, lbn=Unhandled dwarf expression opcode 0x93
) at /usr/src/sys/ufs/ffs/ffs_softdep.c:1847
#12 0xc08315a7 in ffs_balloc_ufs2 (vp=0xc1defaa0, startoffset=Unhandled dwarf expression opcode 0x93
) at /usr/src/sys/ufs/ffs/ffs_balloc.c:822
#13 0xc084be89 in ffs_write (ap=0xd22bbbe0) at /usr/src/sys/ufs/ffs/ffs_vnops.c:662
#14 0xc08f880c in VOP_WRITE_APV (vop=0xc09dd160, a=0xd22bbbe0) at vnode_if.c:698
#15 0xc0726990 in vn_write (fp=0xc1b2aab0, uio=0xd22bbcb0, active_cred=0xc1f3e500, flags=0, td=0xc1c21d80) at vnode_if.h:372
#16 0xc06d5ab8 in dofilewrite (td=0xc1c21d80, fd=0, fp=0xc1b2aab0, auio=0xd22bbcb0, offset=Unhandled dwarf expression opcode 0x93
) at file.h:246
#17 0xc06d58d5 in kern_writev (td=0xc1c21d80, fd=7, auio=0x0) at /usr/src/sys/kern/sys_generic.c:402
#18 0xc06d578f in write (td=0x0, uap=0x0) at /usr/src/sys/kern/sys_generic.c:326
#19 0xc08e4620 in syscall (frame=
      {tf_fs = -1078001605, tf_es = 59, tf_ds = -1078001605, tf_edi = -1077945072, tf_esi = 1024, tf_ebp = -1077944024, tf_isp = -768885404, tf_ebx = 1024, tf_edx = 673012576, tf_ecx = 672935304, tf_eax = 4, tf_trapno = 0, tf_err = 2, tf_eip = 672877763, tf_cs = 51, tf_eflags = 582, tf_esp = -1077945092, tf_ss = 59}) at /usr/src/sys/i386/i386/trap.c:976
#20 0xc08d023f in Xint0x80_syscall () at /usr/src/sys/i386/i386/exception.s:200

--- dmesg ---

---Copyright (c) 1992-2005 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
        The Regents of the University of California. All rights reserved.
FreeBSD 6.0-STABLE #1: Sun Nov 20 10:29:28 CET 2005
    ptrimmel at
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: Pentium III/Pentium III Xeon/Celeron (601.37-MHz 686-class CPU)
  Origin = "GenuineIntel"  Id = 0x673  Stepping = 3
real memory  = 402636800 (383 MB)
avail memory = 384442368 (366 MB)
npx0: [FAST]
npx0: <math processor> on motherboard
npx0: INT 16 interface
acpi0: <ASUS P3B_F> on motherboard
acpi0: Power Button (fixed)
pci_link0: <ACPI PCI Link LNKA> irq 11 on acpi0
pci_link1: <ACPI PCI Link LNKB> irq 10 on acpi0
pci_link2: <ACPI PCI Link LNKC> irq 5 on acpi0
pci_link3: <ACPI PCI Link LNKD> irq 9 on acpi0
Timecounter "ACPI-safe" frequency 3579545 Hz quality 1000
acpi_timer0: <24-bit timer at 3.579545MHz> port 0xe408-0xe40b on acpi0
cpu0: <ACPI CPU> on acpi0
acpi_throttle0: <ACPI CPU Throttling> on cpu0
acpi_button0: <Power Button> on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
agp0: <Intel 82443BX (440 BX) host to PCI bridge> mem 0xe7800000-0xe7bfffff at device 0.0 on pci0
pcib1: <PCI-PCI bridge> at device 1.0 on pci0
pci1: <PCI bus> on pcib1
pci1: <display, VGA> at device 0.0 (no driver attached)
isab0: <PCI-ISA bridge> at device 4.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <Intel PIIX4 UDMA33 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xd800-0xd80f at device 4.1 on pci0
ata0: <ATA channel 0> on atapci0
ata1: <ATA channel 1> on atapci0
uhci0: <Intel 82371AB/EB (PIIX4) USB controller> port 0xd400-0xd41f irq 9 at device 4.2 on pci0
usb0: <Intel 82371AB/EB (PIIX4) USB controller> on uhci0
usb0: USB revision 1.0
uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
pci0: <bridge> at device 4.3 (no driver attached)
xl0: <3Com 3c905C-TX Fast Etherlink XL> port 0xd000-0xd07f mem 0xe2000000-0xe200007f irq 9 at device 9.0 on pci0
miibus0: <MII bus> on xl0
xlphy0: <3c905C 10/100 internal PHY> on miibus0
xlphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
xl0: Ethernet address: 00:01:02:0e:4f:c1
xl1: <3Com 3c905C-TX Fast Etherlink XL> port 0xb800-0xb87f mem 0xe1800000-0xe180007f irq 5 at device 10.0 on pci0
miibus1: <MII bus> on xl1
xlphy1: <3c905C 10/100 internal PHY> on miibus1
xlphy1:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
xl1: Ethernet address: 00:01:02:0e:ba:c9
atapci1: <Promise PDC20270 UDMA100 controller> port 0xb400-0xb407,0xb000-0xb003,0xa800-0xa807,0xa400-0xa403,0xa000-0xa00f mem 0xe1000000-0xe100ffff irq 10 at device 11.0 on pci0
ata2: <ATA channel 0> on atapci1
ata3: <ATA channel 1> on atapci1
ahc0: <Adaptec 2940 Ultra SCSI adapter> port 0x9800-0x98ff mem 0xe0800000-0xe0800fff irq 11 at device 12.0 on pci0
aic7880: Ultra Single Channel A, SCSI Id=7, 16/253 SCBs
atapci2: <Promise PDC20268 UDMA100 controller> port 0x9400-0x9407,0x9000-0x9003,0x8800-0x8807,0x8400-0x8403,0x8000-0x800f mem 0xe0000000-0xe0003fff irq 9 at device 13.0 on pci0
ata4: <ATA channel 0> on atapci2
ata5: <ATA channel 1> on atapci2
atapci3: <Promise PDC20268 UDMA100 controller> port 0x7800-0x7807,0x7400-0x7403,0x7000-0x7007,0x6800-0x6803,0x6400-0x640f mem 0xdf800000-0xdf803fff irq 5 at device 14.0 on pci0
ata6: <ATA channel 0> on atapci3
ata7: <ATA channel 1> on atapci3
fdc0: <floppy drive controller> port 0x3f2-0x3f5,0x3f7 irq 6 drq 2 on acpi0
fdc0: [FAST]
fd0: <1440-KB 3.5" drive> on fdc0 drive 0
ppc0: <ECP parallel printer port> port 0x378-0x37f,0x778-0x77b irq 7 drq 3 on acpi0
ppc0: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode
ppc0: FIFO with 16/16/9 bytes threshold
ppbus0: <Parallel port bus> on ppc0
lpt0: <Printer> on ppbus0
lpt0: Interrupt-driven port
ppi0: <Parallel I/O> on ppbus0
sio0: <16550A-compatible COM port> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
sio0: type 16550A
sio1: <16550A-compatible COM port> port 0x2f8-0x2ff irq 3 on acpi0
sio1: type 16550A
atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: model IntelliMouse Explorer, device ID 4
pmtimer0 on isa0
orm0: <ISA Option ROMs> at iomem 0xc0000-0xc8fff,0xcc000-0xd57ff,0xd8000-0xd87ff,0xdc000-0xde7ff on isa0
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
Timecounter "TSC" frequency 601366646 Hz quality 800
Timecounters tick every 1.000 msec
Waiting 5 seconds for SCSI devices to settle
acd0: CDROM <TOSHIBA CD-ROM XM-6602B/1017> at ata0-master UDMA33
ad4: 114498MB <SAMSUNG SV1204H RK100-15> at ata2-master UDMA100
ad6: 114498MB <SAMSUNG SV1204H RK100-12> at ata3-master UDMA100
ad8: 114498MB <SAMSUNG SV1204H RK100-15> at ata4-master UDMA100
ad10: 114498MB <SAMSUNG SV1204H RK100-15> at ata5-master UDMA100
ad12: 114498MB <SAMSUNG SV1204H RK100-15> at ata6-master UDMA100
ad14: 114498MB <SAMSUNG SV1204H RK100-12> at ata7-master UDMA100
ar0: 114440MB <Promise Fasttrak RAID1> status: READY
ar0: disk0 READY (master) using ad4 at ata2-master
ar0: disk1 READY (mirror) using ad6 at ata3-master
ar1: 228997MB <Promise Fasttrak RAID0+1 (stripe 64 KB)> status: READY
ar1: disk0 READY (master) using ad8 at ata4-master
ar1: disk1 READY (master) using ad10 at ata5-master
ar1: disk2 READY (mirror) using ad12 at ata6-master
ar1: disk3 READY (mirror) using ad14 at ata7-master
Trying to mount root from ufs:/dev/ar0s1a

copy 20GB+ file via FTP
copy 20.000+ small files (i.e. mail spool) via NFS

More information about the freebsd-bugs mailing list