kern/177366: [ieee80211] negative malloc(9) statistics for 80211node

Sergey Kandaurov pluknet at gmail.com
Mon Mar 25 09:30:01 UTC 2013


>Number:         177366
>Category:       kern
>Synopsis:       [ieee80211] negative malloc(9) statistics for 80211node
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 25 09:30:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Sergey Kandaurov
>Release:        FreeBSD 9.1-STABLE
>Organization:
>Environment:
FreeBSD omg 9.1-STABLE FreeBSD 9.1-STABLE #0: Sun Mar 24 18:49:50 MSK 2013     root at omg:/usr/obj/amd64.amd64/usr/src/sys/GENERIC  amd64
>Description:
After upgrading from 8-stable to 9-stable I noticed the
error in malloc(9) type 80211node counter. From vmstat -m:
         Type InUse MemUse HighUse Requests  Size(s)
    80211node 18446744073709551605 18014398509481852K       -        0

18446744073709551605/18014398509481852
1024.00000

18446744073709551605/2^64
.99999

2^64-18446744073709551605
11

Looks like it updates stats on free and forget to update on malloc,
so it goes negative and wraps on uint64_t.

(kgdb) p ((struct malloc_type_internal *)M_80211_NODE->ks_handle)->mti_stats[0]
$20 = {mts_memalloced = 0, mts_memfreed = 61440, mts_numallocs = 0, mts_numfrees = 5, mts_size = 0, _mts_reserved1 = 0, _mts_reserved2 = 0, 
  _mts_reserved3 = 0}
(kgdb) p ((struct malloc_type_internal *)M_80211_NODE->ks_handle)->mti_stats[1]
$21 = {mts_memalloced = 0, mts_memfreed = 73728, mts_numallocs = 0, mts_numfrees = 6, mts_size = 0, _mts_reserved1 = 0, _mts_reserved2 = 0, 
  _mts_reserved3 = 0}
(kgdb) p mp_ncpus
$1 = 2

mts_numfrees[i] - mts_numallocs[i] => 11
>How-To-Repeat:

>Fix:


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


More information about the freebsd-bugs mailing list