Subject: Re: panic on high network traffic
To: doomwarrior <doomwarriorx@gmail.com>
From: Heitzso <heitzso@growthmodels.com>
List: port-sparc
Date: 02/25/2006 06:38:07
I'm noticing netbsd 2.1 in your console listings
which has the limited memory in the default kernel config. 

I believe that's been corrected in the latest 3.0 series.
But since 2.1 is otherwise stable for you you may wish
to just adjust the kernel memory parameters in a custom
kernel memory config file and build a new kernel.

Note I'm somewhat shooting in the dark in that the
out of memory problem could also be triggered by some
problem in the network code.

I believe the variable you want to alter is NKMEMPAGES
and/or its variants.  Google on "NKMEMPAGES netbsd sparc"
or perhaps someone familiar with this problem on this list
can explain better.

For instance:
    http://mail-index.netbsd.org/port-sparc/2006/01/13/0003.html
    http://blog.gmane.org/gmane.os.netbsd.ports.sparc/month=20051201

When I was running netbsd 2.x I had the following in my custom
kernel config file:
  NKMEMPAGES=8192   
to avoid the out of memory panic problem.

> Hi
> i use my SS20 box as my NAT-router and discovered last night, that it 
> crash on high network traffic. It's more or less reproducible with an
> nmap scan  from my private network to the www. I had this panic 
> several times, but it's the first time i got it while i had a serial 
> connection.
> Sometimes there is also a ping cpu warning after the NMI before 
> crashing. I think i have this error too with 2x SuperSparcsII, but i 
> have to verify.
>
> Best Regards
>
> //----------------------- The Reboot 
> ----------------------------------------------
> panic: malloc: out of space in kmem_mapCopyright (c) 1996, 1997, 1998, 
> 1999, 2000, 2001, 2002, 2003, 2004, 2005
>    The NetBSD Foundation, Inc.  All rights reserved.
> Copyright (c) 1982, 1986, 1989, 1991, 1993
>    The Regents of the University of California.  All rights reserved.
>
> NetBSD 2.1 (SPARKY.MP) #0: Sat Nov 19 23:06:37 CET 2005
>        doomwarrior@sparky:/usr/src/sys/arch/sparc/compile/SPARKY.MP
> total memory = 255 MB
> avail memory = 246 MB
> bootpath: 
> /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@3,0
> mainbus0 (root): SUNW,SPARCstation-20: hostid 72865074
> cpu0 at mainbus0: mid 8: RT620/625 @ 180 MHz, on-chip FPU
> cpu0: 512K byte write-back, 32 bytes/line, sw flush: cache enabled
> cpu1 at mainbus0: mid 10: RT620/625 @ 180 MHz, on-chip FPU
> cpu1: 512K byte write-back, 32 bytes/line, sw flush: cache enabled
> obio0 at mainbus0
> clock0 at obio0 slot 0 offset 0x200000: mk48t08
> timer0 at obio0 slot 0 offset 0x300000: delay constant 59
> zs0 at obio0 slot 0 offset 0x100000 level 12 softpri 6
> zstty0 at zs0 channel 0 (console i/o)
> zstty1 at zs0 channel 1
> zs1 at obio0 slot 0 offset 0x0 level 12 softpri 6
> kbd0 at zs1 channel 0: baud rate 1200
> ms0 at zs1 channel 1: baud rate 1200
> fdc0 at obio0 slot 0 offset 0x700000 level 11 softpri 4: chip 82077
> fd0 at fdc0 drive 0: 1.44MB 80 cyl, 2 head, 18 sec
> auxreg0 at obio0 slot 0 offset 0x800000
> power0 at obio0 slot 0 offset 0xa01000 level 2
> iommu0 at mainbus0 ioaddr 0xe0000000: version 0x3/0x1, page-size 4096, 
> range 64MB
> sbus0 at iommu0: clock = 25 MHz
> dma0 at sbus0 slot 15 offset 0x400000: DMA rev 2
> esp0 at dma0 slot 15 offset 0x800000 level 4: ESP200, 40MHz, SCSI ID 7
> scsibus0 at esp0: 8 targets, 8 luns per target
> ledma0 at sbus0 slot 15 offset 0x400010: DMA rev 2
> le0 at ledma0 slot 15 offset 0xc00000 level 6: address 08:00:20:86:50:74
> le0: 8 receive buffers, 2 transmit buffers
> bpp0 at sbus0 slot 15 offset 0x4800000 level 2 (ipl 3): DMA rev 2
> SUNW,DBRIe at sbus0 slot 14 offset 0x10000 level 9 not configured
> dma1 at sbus0 slot 2 offset 0x81000: DMA rev esc
> esp1 at dma1 slot 2 offset 0x80000 level 3 (ipl 5): ESP200, 40MHz, 
> SCSI ID 7
> scsibus1 at esp1: 8 targets, 8 luns per target
> lebuffer0 at sbus0 slot 2 offset 0x40000: 128K memory
> le1 at lebuffer0 slot 2 offset 0x60000 level 4 (ipl 7): address 
> 08:00:20:86:50:74
> le1: 64 receive buffers, 16 transmit buffers
> cgsix0 at sbus0 slot 3 offset 0x0 level 9: SUNW,501-2325, 1152 x 900, 
> rev 11
> cgsix0: attached to /dev/fb
> eccmemctl0 at mainbus0 ioaddr 0x0: version 0x0/0x2
> Kernelized RAIDframe activated
> scsibus0: waiting 2 seconds for devices to settle...
> scsibus1: waiting 2 seconds for devices to settle...
> sd0 at scsibus0 target 3 lun 0: <COMPAQ, BD018122C9, B016> disk fixed
> sd0: 17365 MB, 7001 cyl, 20 head, 254 sec, 512 bytes/sect x 35565080 
> sectors
> sd0: sync (100.00ns offset 15), 8-bit (10.000MB/s) transfers, tagged 
> queueing
> cd0 at scsibus0 target 6 lun 0: <TOSHIBA, XM-4101TASUNSLCD, 3424> 
> cdrom removable
> cd0: async, 8-bit transfers
> root on sd0a dumps on sd0b
> root file system type: ffs
> cpu0: booting secondary processors: cpu1
>
> //-------------------------- The panic 
> ----------------------------------------------------------
> ipf_nattable_max reduced to 6025
> ipf_nattable_max reduced to 5918
> ipf_nattable_max reduced to 5806
>
> NetBSD/sparc (sparky) (console)
>
> login: root
> sbrk: grow 65536 failed, error = 12
> Password:
> Last login: Sat Feb 25 00:06:42 2006 on console
> Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
>    The NetBSD Foundation, Inc.  All rights reserved.
> Copyright (c) 1982, 1986, 1989, 1991, 1993
>    The Regents of the University of California.  All rights reserved.
>
> Feb 25 09:54:40 sparky login: ROOT LOGIN (root) ON console
> NetBSD 2.1 (SPARKY.MP) #0: Sat Nov 19 23:06:37 CET 2005
>
> Welcome to NetBSD!
>
> Feb 25 09:54:40 sparky login: ROOT LOGIN (root) ON console
> You have mail.
> Terminal type is sun.
> sbrk: grow 4096 failed, error = 12
> -bash: xmalloc: cannot allocate 560 bytes (0 bytes allocated)
>
> NetBSD/sparc (sparky) (console)
>
> login: root
> Password:
> Last login: Sat Feb 25 09:54:40 2006 on console
> Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
>    The NetBSD Foundation, Inc.  All rights reserved.
> Copyright (c) 1982, 1986, 1989, 1991, 1993
>    The Regents of the University of California.  All rights reserved.
>
> NetBSD 2.1 (SPARKY.MP) #0: Sat Nov 19 23:06:37 CET 2005
>
> Welcome to NetBSD!
>
> You have mail.
> Terminal type is sun.
> sbrk: grow 4096 failed, error = 12
> -bash: xmalloc: cannot allocate 560 bytes (0 bytes allocated)
>
>
> NetBSD/sparc (sparky) (console)
>
> login: root
> Password:
> Last login: Sat Feb 25 09:54:51 2006 on console
> Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
>    The NetBSD Foundation, Inc.  All rights reserved.
> Copyright (c) 1982, 1986, 1989, 1991, 1993
>    The Regents of the University of California.  All rights reserved.
>
> NetBSD 2.1 (SPARKY.MP) #0: Sat Nov 19 23:06:37 CET 2005
>
> Welcome to NetBSD!
>
> You have mail.
> Terminal type is sun.
> sbrk: grow 4096 failed, error = 12
> -bash: xmalloc: cannot allocate 560 bytes (0 bytes allocated)
>
> NetBSD/sparc (sparky) (console)
>
> login: Feb 25 09:55:03 sparky last message repeated 2 times
>
>
> NetBSD/sparc (sparky) (console)
>
> login: root
> Password:panic: malloc: out of space in kmem_map
> syncing disks... 6 6 5 5 5 5 5 5 5 3 3 2 2 2 2 1 1 1 1 1 done
> Frame pointer is at 0xf3769980
> Call traceback:
>  pc = 0xf0252060  args = (0xf02a0400, 0x5, 0x0, 0x0, 0xf3769aa0, 0x1, 
> 0xf37699e8) fp = 0xf37699e8
>  pc = 0xf0190e54  args = (0x100, 0x0, 0x0, 0x0, 0xffffffff, 
> 0xffffffff, 0xf3769a58) fp = 0xf3769a58
>  pc = 0xf0170cc4  args = (0xf0298290, 0x0, 0x1000, 0x0, 0xf0313c00, 
> 0x100, 0xf3769ac0) fp = 0xf3769ac0
>  pc = 0xf015a8b0  args = (0x0, 0xf02ca324, 0x0, 0xf0832e80, 0x1, 
> 0xf02e9000, 0xf3769b30) fp = 0xf3769b30
>  pc = 0xf015aa10  args = (0xf252aaf0, 0xf3769e50, 0xf09ce000, 0x13, 
> 0x0, 0x597980, 0xf3769b98) fp = 0xf3769b98
>  pc = 0xf015a78c  args = (0xf252aaf0, 0xf3769e50, 0xf09ce000, 
> 0xf09cdc00, 0xf3769c7c, 0x16d, 0xf3769c00) fp = 0xf3769c00
>  pc = 0xf0167d70  args = (0xf252aaf0, 0xf3769e50, 0xf09ce000, 0x404, 
> 0x0, 0xf02ca000, 0xf3769c88) fp = 0xf3769c88
>  pc = 0xf0167f6c  args = (0xf02ca000, 0xf3769e50, 0x0, 0x0, 
> 0xf3769f28, 0x1, 0xf3769d10) fp = 0xf3769d10
>  pc = 0xf025b534  args = (0xf2532770, 0xf3769f28, 0xf2532770, 0x0, 
> 0xf3769f28, 0x81c06000, 0xf3769ec0) fp = 0xf3769ec0
>  pc = 0xf0006500  args = (0x3b, 0xf3769fb0, 0x1049efac, 0x81c060f4, 
> 0x400, 0xf3769f28, 0xf3769f50) fp = 0xf3769f50
>  pc = 0x10388934  args = (0x10204ca8, 0xeffff6c8, 0x24120, 0xf3769fb0, 
> 0x3c8, 0x104d1470, 0xeffff600) fp = 0xeffff600
>
> dumping to dev 7,1 offset 1523959
> dump Async registers (mid 8): afsr=0<AFA=0>; afva=0x00
> Async registers (mid 10): afsr=0<AFA=0>; afva=0x00
> cpu0: NMI: system interrupts: 100c0400<VME=0,SBUS=8,SC,T,M>
> memory error:
>    EFSR: 10002<DW=0,SYNDROME=0,ME>
>    MBus transaction: fce4d30<VAH=0,TYPE=3,SIZE=5,C,VA=39,S,MID=0>
>    address: 0x0f0375000
>    module location: ?
> Type  'go' to resume
> <#0> ok boot
> Resetting ...