Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Mar 2013 09:27:11 GMT
From:      Sergey Kandaurov <pluknet@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/177366: [ieee80211] negative malloc(9) statistics for 80211node
Message-ID:  <201303250927.r2P9RBx5068772@red.freebsd.org>
Resent-Message-ID: <201303250930.r2P9U0cZ087950@freefall.freebsd.org>

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

>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@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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201303250927.r2P9RBx5068772>