From dinoex@net2.dinoex.sub.org  Thu Feb  8 03:10:04 2001
Return-Path: <dinoex@net2.dinoex.sub.org>
Received: from net2.dinoex.sub.org (net2.dinoex.de [212.184.201.182])
	by hub.freebsd.org (Postfix) with ESMTP id 6E2D537B401
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  8 Feb 2001 03:10:03 -0800 (PST)
Received: (from dinoex@localhost)
	by net2.dinoex.sub.org (8.11.2/8.11.2) id f18B9kw11306; Thu, 8 Feb 2001 12:09:46 +0100 (CET)
	(envelope-from dinoex)
Message-Id: <200102081109.f18B9kw11306@net2.dinoex.sub.org>
Date: Thu, 8 Feb 2001 12:09:46 +0100 (CET)
From: dirk.meyer@dinoex.sub.org
Reply-To: dirk.meyer@dinoex.sub.org
To: FreeBSD-gnats-submit@freebsd.org
Subject: mbuf memory leak in de0 driver
X-Send-Pr-Version: 3.2

>Number:         24949
>Category:       i386
>Synopsis:       mbuf memory leak in de0 driver
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 08 03:20:01 PST 2001
>Closed-Date:    Thu Jun 14 21:41:15 PDT 2001
>Last-Modified:  Thu Jun 14 21:42:33 PDT 2001
>Originator:     Dirk Meyer
>Release:        FreeBSD 4.2.-RELEASE i386
>Organization:
privat
>Environment:

	FreeBSD 4.2-RELEASE /usr/obj/data/src/sys/GENERIC i386
	Gerneric Kernel
	Apache Webserer, no connection to the internet

 /kernel: de0: <Digital 21041 Ethernet> port 0x9400-0x947f \
	mem 0xe0800000-0xe080007f irq 12 at device 10.0 on pci0
 /kernel: de0: SMC 21041 [10Mb/s] pass 2.1
 /kernel: de0: address 00:e0:29:36:5d:94
 /kernel: sym0: <895> port 0x9000-0x90ff mem 0xdf800000-0x
 /kernel: de0: enabling 10baseT port

	FreeBSD 4.2-RELEASE /usr/obj/data/src/sys/GENERIC i386
	Gerneric Kernel
	Apache Webserer, Squid-Proxy

 /kernel.old: de0: enabling Full Duplex 10baseT port
 /kernel: de0: <Digital 21041 Ethernet> rev 0x21 int a irq 5 on pci0.9.0
 /kernel: de0: SMC 21041 [10Mb/s] pass 2.1
 /kernel: de0: address 00:e0:29:36:e2:df
 /kernel: de1: <Digital 21041 Ethernet> rev 0x21 int a irq 10 on pci0.10.0
 /kernel: de1: SMC 21041 [10Mb/s] pass 2.1
 /kernel: de1: address 00:e0:29:49:8d:3e
 /kernel: de0: enabling 10baseT port
 /kernel: de1: enabling 10baseT port
 /kernel: de0: enabling 10baseT port
 /kernel: de0: enabling Full Duplex 10baseT port

>Description:

	Network operations start to slow down times 2 and more.
	Logs of mbuf may help, Lines with "0" omitted.

-------------
$ netstat -m
101/432/4096 mbufs in use (current/peak/max):
        68 mbufs allocated to data
        33 mbufs allocated to packet headers
34/206/1024 mbuf clusters in use (current/peak/max)
520 Kbytes allocated to network (16% of mb_map in use)

$ ifconfig de0 down
$ netstat -m
2/432/4096 mbufs in use (current/peak/max):
        1 mbufs allocated to data
        1 mbufs allocated to packet headers
0/206/1024 mbuf clusters in use (current/peak/max)
520 Kbytes allocated to network (16% of mb_map in use)

$ ifconfig de0 up
$ netstat -m
34/432/4096 mbufs in use (current/peak/max):
        33 mbufs allocated to data
        1 mbufs allocated to packet headers
32/206/1024 mbuf clusters in use (current/peak/max)
520 Kbytes allocated to network (16% of mb_map in use)

-------------
319/1152/4096 mbufs in use (current/peak/max):
        240 mbufs allocated to data
        79 mbufs allocated to packet headers
111/422/1024 mbuf clusters in use (current/peak/max)
1132 Kbytes allocated to network (36% of mb_map in use)

156/1152/4096 mbufs in use (current/peak/max):
        83 mbufs allocated to data
        73 mbufs allocated to packet headers
73/422/1024 mbuf clusters in use (current/peak/max)
1132 Kbytes allocated to network (36% of mb_map in use)

188/1152/4096 mbufs in use (current/peak/max):
        115 mbufs allocated to data
        73 mbufs allocated to packet headers
105/422/1024 mbuf clusters in use (current/peak/max)
1132 Kbytes allocated to network (36% of mb_map in use)

60/1152/4096 mbufs in use (current/peak/max):
        54 mbufs allocated to data
        6 mbufs allocated to packet headers
53/422/1024 mbuf clusters in use (current/peak/max)
1132 Kbytes allocated to network (36% of mb_map in use)

92/1152/4096 mbufs in use (current/peak/max):
        86 mbufs allocated to data
        6 mbufs allocated to packet headers
85/422/1024 mbuf clusters in use (current/peak/max)
1132 Kbytes allocated to network (36% of mb_map in use)
-------------

>How-To-Repeat:

	I have no idea what causes this.
	But another server with and xl0 interface works fine.

>Fix:

	hack:
	ifconfig down / ifconfig up seems to keep the serrver useable


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->		 feedback  
State-Changed-By: bmilekic 
State-Changed-When: Mon Jun 4 14:51:45 PDT 2001 
State-Changed-Why:  
The PR `netstat -m' output(s) suggest that there is no leak but only that 
something may be pre-allocating several mbufs, which isn't a big deal. 

The number of allocated mbufs and clusters first rises but then decreases, 
even though the peak clearly rises, but the system seems to stay steady 
from that point on. A `slow down' is mentionned, but it is difficult from  
the provided information to determine where the slow-down is occuring and 
certainly, we have not observed a similar thing here. 

The PR is not being closed just yet. I would like to urge the submitter to 
re-submit, if possible, some more information regarding the slow-down, assuming 
that it is still occuring and, if it is no longer occuring, to let us know 
so that we can close the PR.  

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=24949 

From: dirk.meyer@dinoex.sub.org (Dirk Meyer)
To: freebsd-gnats-submit@FreeBSD.org, bmilekic@FreeBSD.org,
	freebsd-bugs@FreeBSD.org
Cc:  
Subject: Re: i386/24949: mbuf memory leak in de0 driver
Date: Fri, 08 Jun 2001 10:10:45 +0200

 > that it is still occuring and, if it is no longer occuring, to let us know
 > so that we can close the PR. 
 
 Test with 4.3 in progress, final information will follow in a few days.
 
 kind regards Dirk
 
 - Dirk Meyer, Im Grund 4, 34317 Habichtswald, Germany

From: dirk.meyer@dinoex.sub.org (Dirk Meyer)
To: freebsd-gnats-submit@FreeBSD.org, bmilekic@FreeBSD.org,
	freebsd-bugs@FreeBSD.org
Cc:  
Subject: Re: i386/24949: mbuf memory leak in de0 driver
Date: Fri, 15 Jun 2001 06:24:33 +0200

 > Test with 4.3 in progress, final information will follow in a few days.
 
 The network slowdown did not oocur any more,
 we can take this Problem as fixed and close the PR.
 
 The new kernal was compiled with NMBCLUSTERS=8192 too.
 
 kind regards Dirk
 
 - Dirk Meyer, Im Grund 4, 34317 Habichtswald, Germany
State-Changed-From-To: feedback->closed 
State-Changed-By: bmilekic 
State-Changed-When: Thu Jun 14 21:41:15 PDT 2001 
State-Changed-Why:  
Problem fixed. Submitter says it no longer happens. Thanks!  

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=24949 
>Unformatted:
