Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 09 Aug 2006 12:39:44 +0400
From:      Andrej Zverev <az@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   kern/101689: [panic] kmem_malloc in UMA
Message-ID:  <E1GAjbM-0002N7-CV@mail.electro-com.ru>
Resent-Message-ID: <200608090840.k798eEvq088332@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         101689
>Category:       kern
>Synopsis:       [panic] kmem_malloc in UMA
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 09 08:40:13 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Andrej Zverev
>Release:        
>Organization:
>Environment:


	
>Description:
	I'm trying to create > 20000 vlan interfaces.
	#!/usr/bin/perl

	for ($i=0; $i<20000; $i++)
	{
		system ("ifconfig vlan$i create");
		system ("ifconfig vlan$i vlan 10 vlandev rl0 10.10.10.10/24");
	}

	and then system out of memory, panic happens, but it's not right.
	Trace of panic attached, if i can provide extra detail, just ask

	
>How-To-Repeat:
	
>Fix:

	

--- trace.txt begins here ---
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-marcel-freebsd".

Unread portion of the kernel message buffer:
panic: kmem_malloc(4096): kmem_map too small: 83427328 total allocated
Uptime: 16m43s
Dumping 255 MB (2 chunks)
  chunk 0: 1MB (160 pages) ... ok
  chunk 1: 255MB (65264 pages) 239 223 207 191 175 159 143 127 111 95 79 63 47 31 15

#0  doadump () at pcpu.h:165
165		__asm __volatile("movl %%fs:0,%0" : "=r" (td));
(kgdb) 
(kgdb) f 1
#1  0xc064dee1 in boot (howto=260) at ../../../kern/kern_shutdown.c:402
402			doadump();
(kgdb) f 2
#2  0xc064e178 in panic (
    fmt=0xc08bb065 "kmem_malloc(%ld): kmem_map too small: %ld total allocated") at ../../../kern/kern_shutdown.c:558
558		boot(bootopt);
(kgdb) f 3
#3  0xc07bc41d in kmem_malloc (map=0xc14430c0, size=4096, flags=2)
    at ../../../vm/vm_kern.c:299
299				panic("kmem_malloc(%ld): kmem_map too small: %ld total allocated",
(kgdb) f 4
#4  0xc07b3cea in page_alloc (zone=0xc144d780, bytes=4096, pflag=0x0, wait=2)
    at ../../../vm/uma_core.c:958
958		p = (void *) kmem_malloc(kmem_map, bytes, wait);
(kgdb) f 5
#5  0xc07b3821 in slab_zalloc (zone=0xc144d780, wait=2)
    at ../../../vm/uma_core.c:823
823		mem = keg->uk_allocf(zone, keg->uk_ppera * UMA_SLAB_SIZE,
(kgdb) f 6
#6  0xc07b4fc0 in uma_zone_slab (zone=0xc144d780, flags=2)
    at ../../../vm/uma_core.c:2025
2025			slab = slab_zalloc(zone, flags);
(kgdb) f 7
#7  0xc07b51dc in uma_zalloc_bucket (zone=0xc144d780, flags=2)
    at ../../../vm/uma_core.c:2134
2134			flags |= M_NOWAIT;
(kgdb) f 8
#8  0xc07b4e51 in uma_zalloc_arg (zone=0xc144d780, udata=0x0, flags=2)
    at ../../../vm/uma_core.c:1942
1942		if (uma_zalloc_bucket(zone, flags)) {
(kgdb) f 9
#9  0xc06437d2 in malloc (size=32, mtp=0xc091c280, flags=2) at uma.h:275
275		return uma_zalloc_arg(zone, NULL, flags);
(kgdb) f 10
#10 0xc066fb4a in ioctl (td=0xc27c9600, uap=0xd0e40d04)
    at ../../../kern/sys_generic.c:580
580			memp = malloc((u_long)size, M_IOCTLOPS, M_WAITOK);
(kgdb) f 11
#11 0xc084211b in syscall (frame=
      {tf_fs = 59, tf_es = 59, tf_ds = 59, tf_edi = 134581856, tf_esi = -1077940715, tf_ebp = -1077943160, tf_isp = -790360732, tf_ebx = 3, tf_edx = 9, tf_ecx = 7, tf_eax = 54, tf_trapno = 12, tf_err = 2, tf_eip = 672405375, tf_cs = 51, tf_eflags = 642, tf_esp = -1077943188, tf_ss = 59})
    at ../../../i386/i386/trap.c:979
979			PTRACESTOP_SC(p, td, S_PT_SCE);
(kgdb) f 12
#12 0xc0830d5f in Xint0x80_syscall () at ../../../i386/i386/exception.s:194
194		movl	$KDSEL,%eax		/* switch to kernel segments */
Current language:  auto; currently asm
(kgdb) f 13
#13 0x00000033 in ?? ()
(kgdb) quit
--- trace.txt ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E1GAjbM-0002N7-CV>