Re: mbuf count negative

From: Robert Watson <rwatson_at_freebsd.org>
Date: Sun, 5 Dec 2004 18:51:15 +0000 (GMT)
On Sun, 5 Dec 2004, Barney Wolff wrote:

> Is anybody else seeing this?

Currently, the mbuf counters in the mbuf allocator are subject to races.
I have a somewhat dated patch at:

    http://www.watson.org/~robert/freebsd/netperf/20040910-atomic-mballoc.diff

It replaces non-atomic maintenance of the counters with atomic
maintenance.  However, this adds measurably to the cost of allocation, so
I've been reluctant to commit it.  The counters maintained by UMA are
likely sufficient to generate the desired mbuf output now that we have
mbuma, but I haven't had an opportunity to walk through the details of it. 
I hope to do so once I get closer to merging patches to use critical
sections to protect UMA per-cpu caches, since I need to redo parts of the
sysctl code then anyway.  You might want to give this patch, or one much
like it, a spin to confirm that the race is the one I think it is.  The
race in updating mbuf allocator statistics is one I hope to get fixed
prior to 5.4.

Robert N M Watson             FreeBSD Core Team, TrustedBSD Projects
robert_at_fledge.watson.org      Principal Research Scientist, McAfee Research


> 
> lab:/root # netstat -m
> 4294959731 mbufs in use
> 1170/25600 mbuf clusters in use (current/max)
> 0/3/6656 sfbufs in use (current/peak/max)
> 448 KBytes allocated to network
> 0 requests for sfbufs denied
> 0 requests for sfbufs delayed
> 0 requests for I/O initiated by sendfile
> 650 calls to protocol drain routines
> lab:/root # uname -a
> FreeBSD lab.databus.com 6.0-CURRENT FreeBSD 6.0-CURRENT #0: Fri Dec  3 21:44:57 EST 2004     toor_at_lab.databus.com:/usr/obj/usr/src/sys/LAB  i386
> 
> It happens almost instantly during periodic when the system is used to
> receive a backup via nfs.  Normal operation, including a dozen hours of
> port building, does not cause it.  It is consistent, 3 times now.
> 
> H/W is Asus A7M266-D with 2xAthlon 2200MP, 1GB, 39160, gvinum, em.
> 
> Problem did not occur with prior -current from 11/19/04.  Other than cvsup,
> I changed make.conf to say CPUTYPE=athlon-mp (was i686 or nothing).
> 
> What can I do to help debug this?
> 
> -- 
> Barney Wolff         http://www.databus.com/bwresume.pdf
> I'm available by contract or FT, in the NYC metro area or via the 'Net.
> _______________________________________________
> freebsd-current_at_freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe_at_freebsd.org"
> 
Received on Sun Dec 05 2004 - 17:53:39 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:23 UTC